-
Notifications
You must be signed in to change notification settings - Fork 0
61 put project #78
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
base: main
Are you sure you want to change the base?
61 put project #78
Conversation
| if (rawPath.startsWith('/') && rawPath.split('/').length === 2 && method === 'PUT') { | ||
| const id = rawPath.split('/')[1]; | ||
| if (!id) return json(400, { message: 'id is required' }); | ||
| const body = event.body ? JSON.parse(event.body) as Record<string, {name:string, total_budget:number}> : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wrote util helper funcs to validate fields bc 1. detailed err messages, 2. ensure data being processed is in correct format, 3. faster performance - its not up in main yet, so probably just note for future work to use those methods to validate fields here!
Yurika-Kan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff, just a comment on validating fields before trying to put them in & prehandling them before database does!
nourshoreibah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Yurika said, feel free to steal her data validation things
ℹ️ Issue
Closes #61
📝 Description
project/{projectId}nameandtotal_budget✔️ Verification