delete task-data interface

This commit is contained in:
Chneemann 2024-04-09 10:09:10 +02:00
parent 484df8e5b9
commit 27e5e71639
3 changed files with 4 additions and 11 deletions

View file

@ -47,6 +47,7 @@ export class AddTaskComponent {
addSubtask(subtaskName: string) { addSubtask(subtaskName: string) {
this.taskData.subtasksTitle.unshift(subtaskName); this.taskData.subtasksTitle.unshift(subtaskName);
this.taskData.subtasksDone.push(false);
this.saveTaskData(); this.saveTaskData();
} }
@ -55,6 +56,7 @@ export class AddTaskComponent {
this.taskData.subtasksTitle.indexOf(subtaskName), this.taskData.subtasksTitle.indexOf(subtaskName),
1 1
); );
this.taskData.subtasksDone.splice(1);
this.saveTaskData(); this.saveTaskData();
} }

View file

@ -1,9 +0,0 @@
export interface TaskData {
title: string;
description: string;
date: string;
priority: string;
category: string;
assigned: string[];
subtasksTitle: string[];
}

View file

@ -10,7 +10,7 @@ import {
} from '@angular/fire/firestore'; } from '@angular/fire/firestore';
import { Task } from '../interfaces/task.interface'; import { Task } from '../interfaces/task.interface';
import { User } from '../interfaces/user.interface'; import { User } from '../interfaces/user.interface';
import { TaskData } from '../interfaces/task-data.interface';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
@ -58,7 +58,7 @@ export class FirebaseService implements OnDestroy {
}); });
} }
async addNewTask(task: TaskData) { async addNewTask(task: Task) {
await addDoc(collection(this.firestore, 'tasks'), task) await addDoc(collection(this.firestore, 'tasks'), task)
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);