Description
The POST /tasks endpoint allows creating tasks with whitespace-only titles like " " or "\t". The validation check only rejects falsy values (empty string, null, undefined) but doesn't trim whitespace.
Steps to reproduce
curl -X POST http://localhost:3000/tasks \
-H "Content-Type: application/json" \
-d '{"title": " "}'
Expected behavior
Should return 400 with an error message like "title cannot be blank".
Actual behavior
Returns 201 and creates a task with a whitespace-only title.
Additional context
The same issue likely exists for the PATCH endpoint when updating a title to whitespace.
Description
The
POST /tasksendpoint allows creating tasks with whitespace-only titles like" "or"\t". The validation check only rejects falsy values (empty string, null, undefined) but doesn't trim whitespace.Steps to reproduce
Expected behavior
Should return
400with an error message like"title cannot be blank".Actual behavior
Returns
201and creates a task with a whitespace-only title.Additional context
The same issue likely exists for the
PATCHendpoint when updating a title to whitespace.