From 6b3877aac724d9692a099e23ca5ed1e1b17037be Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Thu, 4 May 2023 08:38:32 -0400 Subject: REST DELETE and fun with Postman --- practice/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/practice/index.js b/practice/index.js index 2abb422..f6f51a5 100644 --- a/practice/index.js +++ b/practice/index.js @@ -43,7 +43,7 @@ app.get('/api/notes/:id', (request, response) => { app.delete('/api/notes/:id', (request, response) => { const id = Number(request.params.id) - const note = notes.filter(note => note.id !== id) + notes = notes.filter(note => note.id !== id) response.status(204).end() }) -- cgit v1.2.3