From b8ffece10574a885a13337da563aa87aa98cf588 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Mon, 1 Apr 2024 10:48:14 +0200 Subject: [PATCH] clean code --- src/app/services/task.service.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/services/task.service.ts b/src/app/services/task.service.ts index 4cf12a6..94f62e3 100644 --- a/src/app/services/task.service.ts +++ b/src/app/services/task.service.ts @@ -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); }); });