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

Fix update user resolver to exclude branches as it is only changed by super admin via other resolvers #665

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

MatoPlus
Copy link
Member

@MatoPlus MatoPlus commented Aug 30, 2022

Ticket link

Closes #664

Implementation description

  • Updated update user resolvers used by all users to exclude branches as it is only used in the edit profile account and does not have a field to update branches. We use the user management page which uses other branch update resolvers instead.

Steps to test

  1. Login to user with a branch, update profile, user branches still persist and is no longer cleared

What should reviewers focus on?

  • Correctness

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 533821a):

https://sistering-dev--pr665-rickson-edit-profile-1vpf3ga1.web.app

(expires Tue, 06 Sep 2022 15:59:19 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Member

@briantu briantu left a comment

Choose a reason for hiding this comment

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

Getting an error when I click the "Save Changes" button in the edit account page for volunteer. @MatoPlus Can you see if this is related to your changes?

image

@twilkhoo
Copy link
Contributor

Tested locally with Prisma Studio, everything works great! One question not of concern though- when creating accounts (in createAccount of AccountForm.tsx), branches is still set to [] but this makes sense since users only get assigned branches by super admins AFTER their account is created right?

@MatoPlus
Copy link
Member Author

MatoPlus commented Aug 30, 2022

@briantu

Getting an error when I click the "Save Changes" button in the edit account page for volunteer. @MatoPlus Can you see if this is related to your changes?

image

Whoops, forgot to mention that you have to test locally since preview always use staging backend changes.

@MatoPlus
Copy link
Member Author

Tested locally with Prisma Studio, everything works great! One question not of concern though- when creating accounts (in createAccount of AccountForm.tsx), branches is still set to [] but this makes sense since users only get assigned branches by super admins AFTER their account is created right?

This is correct. It doesn't hurt to leave it in for a more complete "create" resolver.

@MatoPlus MatoPlus requested a review from briantu August 30, 2022 18:55
@MatoPlus MatoPlus dismissed briantu’s stale review August 30, 2022 18:55

not tested locally

@twilkhoo
Copy link
Contributor

Tested locally with Prisma Studio, everything works great! One question not of concern though- when creating accounts (in createAccount of AccountForm.tsx), branches is still set to [] but this makes sense since users only get assigned branches by super admins AFTER their account is created right?

This is correct. It doesn't hurt to leave it in for a more complete "create" resolver.

Sounds good, LGTM!

@MatoPlus MatoPlus merged commit 516b7ba into main Aug 30, 2022
@MatoPlus MatoPlus deleted the rickson/edit-profile-clears-branches-bug branch August 30, 2022 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Volunteer/Employee shouldn't change branch
3 participants