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

organization approval workflow #167

Merged
merged 6 commits into from
May 12, 2024
Merged

organization approval workflow #167

merged 6 commits into from
May 12, 2024

Conversation

vilinh
Copy link
Contributor

@vilinh vilinh commented May 5, 2024

Developer: Vi-Linh Vu

Closes #111

Pull Request Summary

Created a tab for viewing organizations pending approval. Added routes to update organizations by user iD using clerk. Added check & cross buttons to organization cards pending approval for admins to approve/deny organizations.

Modifications

  • src/app/api/user/[id]/route.ts: Added PUT route to modify unsafeMetadata by user id.
  • src/app/api/user/route.ts: Added general GET route for Clerk users.
  • src/app/sponsored-organizations/page.tsx:
    • Modified pending filtering status code because it was erroring
    • Added clerkUser ID to organization objects array to use in SponsoredCards
    • Added state and toggle for viewing Organizations Pending Approval
  • src/components/sponsored-org-card.tsx:
    • Modified props to take in Organization object with all necessary data (name, clerkUser, toApprove status)
    • Added fetch requests to update/delete organization unsafeMetadata based on approval/rejection
    • Added check and cross button to approve / reject
  • src/database/organization-schema.ts: Added approved status to Organization schema to use in SponsoredCard

Testing Considerations

  • Tested locally with existing data. Tested approving and rejecting an organization. Updating unsafeMetadata only ever adds to the object, unless you use the same key, then it updates the key within unsafeMetadata. To get rid of a key within unsafeMetadata, you set the value to null.
  • Might need to check if adding the approved status to Organization schema affects/causes bugs for anything else in database.

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Screenshots/Screencast

Screenshot 2024-05-05 at 12 13 32 PM Screenshot 2024-05-05 at 12 13 25 PM

@vilinh vilinh requested review from s-iloo and ryanhu021 May 5, 2024 19:56
Copy link

vercel bot commented May 5, 2024

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

Name Status Preview Comments Updated (UTC)
ecologistics-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 5:23pm

Copy link
Collaborator

@ryanhu021 ryanhu021 left a comment

Choose a reason for hiding this comment

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

looks good!

Copy link
Collaborator

@ryanhu021 ryanhu021 left a comment

Choose a reason for hiding this comment

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

this looks good! could you pull the latest changes from develop and run git merge develop from your branch to merge everything? there have been a lot of changes to the sponsored orgs page so i don't want to accidentally break anything

Copy link
Collaborator

@ryanhu021 ryanhu021 left a comment

Choose a reason for hiding this comment

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

looks good!

@ryanhu021 ryanhu021 merged commit 5cf5cdc into develop May 12, 2024
4 checks passed
@ryanhu021 ryanhu021 deleted the org-approval-workflow branch May 12, 2024 19:23
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.

Approve organization workflow
2 participants