Skip to content

Conversation

@denniwang
Copy link
Contributor

@denniwang denniwang commented Nov 6, 2025

ℹ️ Issue

Closes #61

📝 Description

  • created endpoint to update project information
  • project/{projectId}
  • takes in name and total_budget

✔️ Verification

  • wrote jest tests

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}> : {};
Copy link
Contributor

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!

Copy link
Contributor

@Yurika-Kan Yurika-Kan left a 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!

Copy link
Collaborator

@nourshoreibah nourshoreibah left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Projects] Add Update Project Route (PUT /projects/{id})

4 participants