Summary of What Needs to be Done:
The goals route at src/app/api/goals/route.ts uses !body.target to check for missing target, but !body.target is false when body.target === 0. A goal with target: 0 would be accepted even though it's nonsensical.
Changes that Need to be Made:
- File: src/app/api/goals/route.ts (line 116)
- Change validation to explicitly check for positive number: typeof body.target !== number || body.target <= 0
Impact that it would Provide:
- Prevents creation of invalid goals with target of 0
- Ensures goals have meaningful target values
Summary of What Needs to be Done:
The goals route at src/app/api/goals/route.ts uses !body.target to check for missing target, but !body.target is false when body.target === 0. A goal with target: 0 would be accepted even though it's nonsensical.
Changes that Need to be Made:
Impact that it would Provide: