update task interface

This commit is contained in:
Chneemann 2024-03-25 09:40:24 +01:00
parent 59006cd65b
commit 6bdb99fc06
2 changed files with 8 additions and 7 deletions

View file

@ -1,9 +1,10 @@
export interface Task {
id?: string;
title: string;
description: string;
category: string;
status: string;
subtasksTitle: string;
subtasksDone: boolean;
assigned: number;
subtasksTitle: string[];
subtasksDone: boolean[];
assigned: number[];
}

View file

@ -6,6 +6,7 @@ import {
onSnapshot,
updateDoc,
} from '@angular/fire/firestore';
import { Task } from '../interfaces/task.interface';
@Injectable({
providedIn: 'root',
@ -13,8 +14,8 @@ import {
export class TaskService {
firestore: Firestore = inject(Firestore);
allTasks: any[] = [];
filteredTasks: any[] = [];
allTasks: Task[] = [];
filteredTasks: Task[] = [];
unsubTask;
@ -26,8 +27,7 @@ export class TaskService {
return onSnapshot(this.getTaskRef(), (list) => {
this.allTasks = [];
list.forEach((element) => {
const taskData = element.data();
taskData['id'] = element.id;
const taskData = { ...(element.data() as Task), id: element.id };
this.allTasks.push(taskData);
});
});