AP-139 (#141)
Reviewed-on: #141
This commit was merged in pull request #141.
This commit is contained in:
@@ -57,13 +57,13 @@ export class EditTaskPage implements OnInit {
|
||||
let assigned: number | null = Number(formValue.assigned);
|
||||
if (assigned === 0) {
|
||||
assigned = null;
|
||||
}
|
||||
};
|
||||
|
||||
const task = {
|
||||
name: formValue.name,
|
||||
reward: formValue.reward,
|
||||
assigned
|
||||
}
|
||||
};
|
||||
|
||||
if (this.isAddMode) {
|
||||
this.taskService.createTask(task);
|
||||
@@ -79,6 +79,25 @@ export class EditTaskPage implements OnInit {
|
||||
this.router.navigate(['/tabs/tasks']);
|
||||
}
|
||||
|
||||
completeAndRecreateTask() {
|
||||
const formValue = this.form.value;
|
||||
let assigned: number | null = Number(formValue.assigned);
|
||||
if (assigned === 0) {
|
||||
assigned = null;
|
||||
};
|
||||
|
||||
const task = {
|
||||
name: formValue.name,
|
||||
reward: formValue.reward,
|
||||
assigned
|
||||
};
|
||||
|
||||
this.taskService.createTask(task);
|
||||
this.taskService.completeTask(this.id);
|
||||
|
||||
this.router.navigate(['/tabs/tasks']);
|
||||
}
|
||||
|
||||
navigateBack() {
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user