From 7a155b63a2c5d7042cd27fecb8fe1ab88b643ee9 Mon Sep 17 00:00:00 2001 From: imelilabourne Date: Tue, 22 Sep 2020 07:51:57 +0800 Subject: [PATCH] remove unnecessary codes --- db.json | 15 +-------------- .../containers/TodoList/todo-list.component.ts | 1 - src/app/Todo-List-App/services/todo.service.ts | 10 ++-------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/db.json b/db.json index 60c051e..e6e3456 100644 --- a/db.json +++ b/db.json @@ -1,16 +1,3 @@ { - "tasks": [ - { - "title": "123", - "completed": false, - "editing": false, - "id": 1 - }, - { - "title": "2dasd", - "completed": false, - "editing": false, - "id": 2 - } - ] + "tasks": [] } \ No newline at end of file diff --git a/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts b/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts index d403680..b7520f8 100644 --- a/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts +++ b/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts @@ -124,7 +124,6 @@ export class TodoList{ }); // if(selectedProducts && selectedProducts.length === 1) { - // } // else{ // this.todoService.deleteAllTask(selectedProducts) diff --git a/src/app/Todo-List-App/services/todo.service.ts b/src/app/Todo-List-App/services/todo.service.ts index e7cb55a..e8c17b3 100644 --- a/src/app/Todo-List-App/services/todo.service.ts +++ b/src/app/Todo-List-App/services/todo.service.ts @@ -27,14 +27,8 @@ export class TodoService{ } deleteTask(id:number){ - return this.http.delete(URL + '/' + id); + return this.http.delete(URL + '/' + id) + .pipe(map((res:any) => res)); } - deleteCompletedTask(id: number[]){ - return this.http.delete(URL + '/' + id) - .pipe(map((res:any) => res.json())); - } - - - } \ No newline at end of file