-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add userProfile controller and PUT /userProfile/:id endpoint #1862
Conversation
✔️ Deploy Preview for dev-partners-bloom ready! 🔨 Explore the source changes: dfefc7e 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-partners-bloom/deploys/615b7ecd52f28f000784ab35 😎 Browse the preview: https://deploy-preview-1862--dev-partners-bloom.netlify.app |
✔️ Deploy Preview for dev-bloom ready! 🔨 Explore the source changes: dfefc7e 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-bloom/deploys/615b7ecd474f2000088dd9e4 😎 Browse the preview: https://deploy-preview-1862--dev-bloom.netlify.app |
df5a3ca
to
f7cbeee
Compare
✔️ Deploy Preview for dev-storybook-bloom ready! 🔨 Explore the source changes: dfefc7e 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-storybook-bloom/deploys/615b7ecd38eb360008ef9c1e 😎 Browse the preview: https://deploy-preview-1862--dev-storybook-bloom.netlify.app |
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.
@pbn4 ,
This looks great. Per my other comment can you please add a few more tests.
await supertest(app.getHttpServer()) | ||
.put(`/userProfile/${userCreateResponse.body.id}`) | ||
.send(userProfileUpdateDto) | ||
.expect(401) |
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.
There should probably be a separate test for ensuring that an unauthorized person can't access this. Can you add another test that generates two users, A and B, and ensure that A cannot update B's profile. And another with an admin updating a user's profile that isn't their own.
779d375
to
f49561d
Compare
…ousing#1862) * Add userProfile controller and PUT /userProfile/:id endpoint * Fix userProfile update security hole allowing user's to edit each others profiles * Fix code style issues with Prettier Co-authored-by: Lint Action <lint-action@samuelmeuli.com> Co-authored-by: Sean Albert <smabert@gmail.com>
Pull Request Template
Issue
Addresses # (#1655)
Description
PUT /userProfile/:id
suited specifically for users updating their own profilesPUT /user/:id
is admin only now, because it allows edits over entireuser
tableType of change
How Can This Be Tested/Reviewed?
Please describe the tests that you ran to verify your changes. Provide instructions so we can review. Please also list any relevant details for your test configuration
Checklist:
yarn generate:client
if I made backend changes