-
Notifications
You must be signed in to change notification settings - Fork 2
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
teacher profile unstyled #20
Conversation
f1f9ee0
to
a254945
Compare
Please address the failing build issue and warning: For the failing build I know what needs to be fixed so feel free to contact me if you need some help with that! |
00a4962
to
1b74398
Compare
4077550
to
1b74398
Compare
bec1d1f
to
fd3b9cb
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
fd3b9cb
to
c1616ea
Compare
c1616ea
to
040860f
Compare
001136e
to
065d8f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the deployment and re-request a review
065d8f8
to
3196ba3
Compare
5ef981b
to
8e5384e
Compare
8e5384e
to
6c09b39
Compare
6c09b39
to
8e4947c
Compare
3424cbe
to
b7446bc
Compare
Thanks! Updated to comments |
src/pages/api/users/email/[email].ts
Outdated
if (encodedAbsences) { | ||
getAbsences = Boolean(encodedAbsences); | ||
} | ||
// TODO: rename realEmail to email to be used in the findUnique later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like having these TODOs in the code. Please make a Notion Ticket for the remaining work 🥺🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Rahul volunteered to make that Notion ticket. Please coordinate with him to ensure that it is accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He said that he would add it to this ticket: https://www.notion.so/uwblueprintexecs/Teacher-Profile-Popup-Frontend-0e847ff1bef04037afd2b4d104875afa?pvs=4
src/pages/api/users/email/[email].ts
Outdated
|
||
try { | ||
// TODO: remove block once emails are set up | ||
// fake stuff begins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't love these comments. I think you should just get rid of them lol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in latest
src/pages/api/users/email/[email].ts
Outdated
import { PrismaClient } from '@prisma/client'; | ||
import type { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
const prisma = new PrismaClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be remaking the PrismaClient each time. We should use the singleton pattern as documented here: https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-dev-practices. I mentioned this in David's PR here: https://github.com/uwblueprint/sistema/pull/19/files#r1789262220, so please have centralized Prisma access like he does in his PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built on top of his branch to share the same utils/prisma here:
bdf4ec0
src/pages/api/users/email/[email].ts
Outdated
} else { | ||
email = useFake ? fakeEmailReq.email : realEmail; | ||
} | ||
// fake stuff ends |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't like this comment.
src/pages/api/users/email/[email].ts
Outdated
}); | ||
|
||
if (!user) { | ||
res.status(400).json({ error: 'User not found' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need - existing api code doesn't use return either:
sistema/src/pages/api/sendEmail.ts
Line 42 in 6800776
res.status(200).json({ message: 'Email sent successfully' }); |
src/pages/api/users/email/[email].ts
Outdated
if (!user) { | ||
res.status(400).json({ error: 'User not found' }); | ||
} else { | ||
res.status(200).json(user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a return?
src/pages/api/users/email/[email].ts
Outdated
res.status(200).json(user); | ||
} | ||
} catch { | ||
res.status(500).json({ error: 'Internal server error' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a return?
src/pages/api/users/email/[email].ts
Outdated
}); | ||
let email; | ||
if (!fakeEmailReq) { | ||
res.status(400).json({ error: 'Database is empty' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a return instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor changes I would appreciate if you made. Otherwise LGTM.
Co-authored-by: Chinemerem <[email protected]>
Co-authored-by: Chinemerem <[email protected]>
* Add Prisma and create Prisma models * Add MailingList table * Add seeding script commmand * Add seeding script * Add seeding script command in package.json * Fix code formatting with prettier * Fix prettier issues * First Commit * Added preliminary files * Fixed Querying Prisma issue via troubleshooting docker * Implemented ICS hosting Feature * Tidied up code, ran lint and prettier * Created ICS Branch. Squashing :) * Added necessary files * Remove uneeded changes * Remove uneeded changes * Remove uneeded changes * Update schema.prisma * Remove unused variables * Move seed.config.ts back * Added ics * Fixed Docker issues * Testing commit * Testing commit * Testing commit * Testing commit * Fixed map issues * Fixed map issues * Testing * Testing * fixed lock file * Update src/pages/ics.tsx Co-authored-by: Chinemerem <[email protected]> * Commited some changes * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> * test * Made changes based on CEO's instructions * fixed merge issues * Made Changes based on CEO's guidance * teacher profile unstyled (#20) * add unstyled teacher profile page with gauth info and x/10 absences --------- Co-authored-by: Rahul Tandon <[email protected]> Co-authored-by: David Lu <[email protected]> Co-authored-by: Chinemerem <[email protected]> * Revert "teacher profile unstyled (#20)" (#37) This reverts commit a81f4e1. sorry * Update utils/prisma.ts Co-authored-by: Chinemerem <[email protected]> * Update src/pages/ics.tsx Co-authored-by: Chinemerem <[email protected]> * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> * Revert Original Files * Fix ICS as per Chinemerem's request * Yeehaw * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> * Update app/api/getAbsences/route.ts Co-authored-by: Chinemerem <[email protected]> --------- Co-authored-by: Kelly Pham <[email protected]> Co-authored-by: Vihaan Jagiasi <[email protected]> Co-authored-by: evelina <[email protected]> Co-authored-by: Chinemerem <[email protected]> Co-authored-by: evelina zheng <[email protected]> Co-authored-by: Rahul Tandon <[email protected]>
Notion ticket link
Implement Unstyled Teacher Profile Page
Implementation description
db:5432
insteadSteps to test
What should reviewers focus on?
Checklist