clean code

This commit is contained in:
Chneemann 2024-04-01 10:48:14 +02:00
parent ffab44bfc3
commit b8ffece105

View file

@ -26,9 +26,7 @@ export class TaskService implements OnDestroy {
return onSnapshot(collection(this.firestore, 'tasks'), (list) => {
this.allTasks = [];
list.forEach((element) => {
const taskData = element.data() as Task;
const taskWithId = { ...taskData };
taskWithId.id = element.id;
const taskWithId = { id: element.id, ...element.data() } as Task;
this.allTasks.push(taskWithId);
});
});