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

Add assign president popup #142

Merged

Conversation

nickbar01234
Copy link
Collaborator

Description

  • Add popup for admins to edit user's role.
  • Update the API route to edit role to take a list of roles to edit

Screenshots

image

Copy link

vercel bot commented Apr 6, 2024

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

Name Status Preview Updated (UTC)
the-legacy-project2 🔄 Building (Inspect) Visit Preview Apr 6, 2024 6:20am

Copy link
Collaborator

@johnny-t06 johnny-t06 left a comment

Choose a reason for hiding this comment

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

LGTM, small nit on the filtering. Tested with by setting myself as Admin and selecting/deselecting both presidents/non-presidents. Good job 👍

const previousPresidents = currentPresidents.filter(
(student) =>
assignedPresidents.find((other) => student.id === other.id) == undefined
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

const previousPresidents = currentPresidents.filter((student) => !assignedPresidents.includes(student));
I think this achieves the same functionality and is more readable

@nickbar01234 nickbar01234 merged commit 18e65e3 into johnny-stephen/newassignment Apr 7, 2024
2 checks passed
@nickbar01234 nickbar01234 deleted the nickbar01234/assign-president branch April 7, 2024 01:02
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.

2 participants