Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved the deleteTodo function and used const. #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RohanHandore
Copy link

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.

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