Skip to content

Commit e80c9c3

Browse files
committed
Remove sentence from wrong place
1 parent 77a3759 commit e80c9c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/3/en/part3c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ app.delete('/api/notes/:id', (request, response, next) => {
855855
})
856856
```
857857

858-
In both of the "successful" cases of deleting a resource, the backend responds with the status code <i>204 no content</i>. The two different cases are deleting a note that exists, and deleting a note that does not exist in the database. The _result_ callback parameter could be used for checking if a resource was actually deleted, and we could use that information for returning different status codes for the two cases if we deem it necessary. Similarly, when sending a PUT request with a non-existent ID, it returns null, but the error isn't caught by the catch block, requiring additional handling. Any other exception that occurs is passed onto the error handler.
858+
In both of the "successful" cases of deleting a resource, the backend responds with the status code <i>204 no content</i>. The two different cases are deleting a note that exists, and deleting a note that does not exist in the database. The _result_ callback parameter could be used for checking if a resource was actually deleted, and we could use that information for returning different status codes for the two cases if we deem it necessary. Any exception that occurs is passed onto the error handler.
859859

860860

861861
The toggling of the importance of a note can be easily accomplished with the [findByIdAndUpdate](https://mongoosejs.com/docs/api/model.html#model_Model-findByIdAndUpdate) method.

0 commit comments

Comments
 (0)