-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feature] Add Edit Functionality #383
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/codeforafrica/PromiseTracker/DRBWYwTYQio7ZtJT1APd5sQDVxRm |
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.
👍🏽 @nerdlet
- We only need one access point
/accounts/profile
. When you receive aGET
, you return current profile. When you receivePATCH
, you update the profile. - No need to pass the profile id from client to the server. The server should pull the id from the session after calling
const session = await getSession({ req });
. This way, we ensure you can only update your profile rather than me login in and passing your id to the server.
Also the alert should only be displayed when someone updates their profile. Notice I just close the dialog without updating anything and yet I get the alert.
src/pages/api/accounts/index.js
Outdated
if (req.method === "GET") { | ||
return registerNewUser(req, res); | ||
} |
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.
Why would we want to register a new user with GET
?
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Description
Fixes # (issue)
Type of change
Desktop Screenshots
Mobile Screenshots
Checklist: