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

Add input validation #6

Closed
JakenHerman opened this issue Oct 14, 2024 · 0 comments · Fixed by #16
Closed

Add input validation #6

JakenHerman opened this issue Oct 14, 2024 · 0 comments · Fixed by #16
Assignees
Labels
enhancement New feature or request

Comments

@JakenHerman
Copy link
Owner

JakenHerman commented Oct 14, 2024

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.

@JakenHerman JakenHerman added the enhancement New feature or request label Oct 14, 2024
@JakenHerman JakenHerman self-assigned this Oct 14, 2024
@JakenHerman JakenHerman added sweep and removed sweep labels Oct 14, 2024
Repository owner deleted a comment from sweep-ai bot Oct 14, 2024
@JakenHerman JakenHerman added aider and removed aider labels Oct 14, 2024
Repository owner deleted a comment from sweep-ai bot Oct 14, 2024
Repository owner deleted a comment from sweep-ai bot Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant