Skip to content

improved the deleteTodo function and used const.#34

Open
RohanHandore wants to merge 1 commit into
Sharvin26:masterfrom
RohanHandore:rohan
Open

improved the deleteTodo function and used const.#34
RohanHandore wants to merge 1 commit into
Sharvin26:masterfrom
RohanHandore:rohan

Conversation

@RohanHandore

Copy link
Copy Markdown

Added input validation to ensure that only valid fields are updated and the request body cannot contain the todoId or createdAt fields. I also added a check to make sure that the document exists before attempting to update it. Finally, I simplified the error handling to only return a 404 error if the document is not found, and to handle all other errors with a generic error message.

Signed-off-by: RohanHandore <110839432+RohanHandore@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant