You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to modify the function add_todo in src/routes.rs to validate input a little bit before processing it. (e.g., checking if the title is not empty). If the input is not valid, we should not add it to the database. Similarly, we shouldn't allow already completed tasks to be added (new to-dos should have the completed field set to false initially.
Let's make this modification and update tests in tests/add_todo.rs accordingly. We should have a success test case as well as an invalid test case.
The text was updated successfully, but these errors were encountered:
We need to modify the function
add_todo
insrc/routes.rs
to validate input a little bit before processing it. (e.g., checking if the title is not empty). If the input is not valid, we should not add it to the database. Similarly, we shouldn't allow alreadycompleted
tasks to be added (new to-dos should have thecompleted
field set tofalse
initially.Let's make this modification and update tests in
tests/add_todo.rs
accordingly. We should have a success test case as well as an invalid test case.The text was updated successfully, but these errors were encountered: