Skip to content
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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

[Feature] Add Edit Functionality #383

wants to merge 23 commits into from

Conversation

nerdlet
Copy link
Contributor

@nerdlet nerdlet commented Mar 16, 2022

Description

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

Desktop Screenshots

Mobile Screenshots

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@vercel
Copy link

vercel bot commented Mar 16, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/codeforafrica/PromiseTracker/DRBWYwTYQio7ZtJT1APd5sQDVxRm
✅ Preview: https://promisetracker-git-feature-edit-codeforafrica.vercel.app

Copy link
Member

@kilemensi kilemensi left a comment

Choose a reason for hiding this comment

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

👍🏽 @nerdlet


  1. We only need one access point /accounts/profile. When you receive a GET, you return current profile. When you receive PATCH, you update the profile.
  2. 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.

Peek 2022-04-14 13-21

Comment on lines 16 to 18
if (req.method === "GET") {
return registerNewUser(req, res);
}
Copy link
Member

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?

@vercel
Copy link

vercel bot commented Apr 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
PromiseTracker ✅ Ready (Inspect) Visit Preview Apr 20, 2022 at 6:53AM (UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants