remove unnecessary codes

This commit is contained in:
imelilabourne 2020-09-22 07:51:57 +08:00
parent 95934a733d
commit 7a155b63a2
3 changed files with 3 additions and 23 deletions

15
db.json
View File

@ -1,16 +1,3 @@
{
"tasks": [
{
"title": "123",
"completed": false,
"editing": false,
"id": 1
},
{
"title": "2dasd",
"completed": false,
"editing": false,
"id": 2
}
]
"tasks": []
}

View File

@ -124,7 +124,6 @@ export class TodoList{
});
// if(selectedProducts && selectedProducts.length === 1) {
// }
// else{
// this.todoService.deleteAllTask(selectedProducts)

View File

@ -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<number[]>(URL + '/' + id)
.pipe(map((res:any) => res.json()));
}
}