Skip to content

Conversation

@denniwang
Copy link
Contributor

@denniwang denniwang commented Oct 23, 2025

ℹ️ Issue

Closes #51

📝 Description

patches user , takes in email, body, and isadmin

✔️ Verification

wrote tests
image

🏕️ (Optional) Future Work / Notes

auth guard + do we want to change isAdmin?

Copy link

@mehanana mehanana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

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.

This looks really good! Only thing is the tests should work regardless of the state of the DB. For the 1st test, you could make sure a user exists and then edit that one, and so maybe find an id then pass it to the endpoint, and make the test auto pass with a warning or something if DB empty? For the 2nd test, you can pick an id one higher than the highest id.

We could definitely have an even less brittle testing setup using transactions and rollback, but for now we can go with this

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.

Ok actually nevermind lol. we are just going to accept that tests require the DB to be in a seeded state. can have a ticket next sprint to seed the DB before tests maybe

@nourshoreibah nourshoreibah merged commit d148307 into main Oct 25, 2025
4 checks passed
@nourshoreibah nourshoreibah deleted the patch-user branch October 25, 2025 21:11
nourshoreibah added a commit that referenced this pull request Oct 25, 2025
This reverts commit d148307.
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.

[Users] Add Update User Route (PATCH /users/{userId})

3 participants