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

Cledi selena edit senior #111

Merged
merged 7 commits into from
Mar 11, 2024
Merged

Cledi selena edit senior #111

merged 7 commits into from
Mar 11, 2024

Conversation

cledi01
Copy link
Collaborator

@cledi01 cledi01 commented Mar 3, 2024

Description

Change senior field to have firstname and lastname in the database, instead of just one name field. Also created a page for chapter leader to view seniors, as well as add new ones @/private/[uid]/chapter-leader/seniors.

Linked front-end senior add pop-up component to the senior API in the new backend route.

Issues

No issue was made for this.

Test

Run npx prisma generate to update the PrismaClient. Then, add a new senior in the /private/[uid]/chapter-leader/seniors page.

Possible Downsides

Lacks logic to validate whether the user is a chapter leader. Double check if the logic to fetch the user, fetch the chapter, fetch the corresponding seniors in that chapter, is in line with intended business logic.

Copy link

vercel bot commented Mar 3, 2024

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

Name Status Preview Updated (UTC)
the-legacy-project2 ✅ Ready (Inspect) Visit Preview Mar 3, 2024 6:28pm

@@ -3,7 +3,8 @@ import { z } from "zod";

export const seniorSchema = z.object({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we potentially use this instead of redefining postSeniorSchema and patchSeniorSchema?

Copy link
Collaborator

@nickbar01234 nickbar01234 left a comment

Choose a reason for hiding this comment

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

Great job guys :) I only have a couple of small feedbacks.

  1. I noticed that you had to change quite a few places with the new schema changes. I think we can utilize the senior schema defined in models/ to reduce work in the future.
  2. Double check the routing in top-level layout.tsx for chapter leaders.
  3. When you render items for CardGrid, don't forget to include a key.

Copy link
Collaborator

@nickbar01234 nickbar01234 left a comment

Choose a reason for hiding this comment

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

I fixed the merge conflicts and updated the sidebar on my end. The functionality remains the same.

@nickbar01234 nickbar01234 merged commit 353e08d into main Mar 11, 2024
4 checks passed
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.

3 participants