Chris Chen 6301d6008b WIP
2024-02-28 15:17:41 -08:00

33 lines
985 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { NbDialogRef } from '@nebular/theme';
import { DropDownOption } from '../../../entity/dropDownOption';
import { HappinessCost } from '../../../entity/happiness-cost.model';
import { AuthService } from '../../../services/auth.service';
@Component({
selector: 'ngx-add-new-cost-dlg',
templateUrl: './add-new-cost-dlg.component.html',
styleUrls: ['./add-new-cost-dlg.component.scss']
})
export class AddNewCostDlgComponent implements OnInit {
taskrOptions: DropDownOption[] = [];
task: HappinessCost;
constructor(
private authService: AuthService,
private dlgRef: NbDialogRef<AddNewCostDlgComponent>
) { }
ngOnInit(): void {
this.task = new HappinessCost();
this.task.tasker = this.authService.userAccess.firstName;
}
close() {
this.dlgRef.close();
}
submit() {
if (this.task.tasker && this.task.content && this.task.amount > 0) {
this.dlgRef.close(this.task);
}
}
}