-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/mraysu/add students backend #57
Conversation
00f5964
to
08f35e6
Compare
Visit the preview URL for this PR (updated for commit d7a7aff): https://pia-dev-60cea--pr57-feature-mraysu-add-s-00a35qul.web.app (expires Wed, 28 Feb 2024 20:47:32 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: b780ee12a240535f7ca0729d49968573a1f3e284 |
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.
Looks great!
} as Student; | ||
} | ||
|
||
export async function createStudent(student: StudentData): Promise<APIResult<Student>> { |
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.
It may be good to add a check here to make sure that the contact information (email, phone) provided of the emergency contact is different from the contact information (email, phone) of the student
Tracking Info
Resolves #17
Changes
.env
, as well as allowed for CORS access between frontend and backend. To test, add the following environmental variablesFRONTEND_ORIGIN
field inbackend/.env
(Ex.FRONTEND_ORIGIN = "http://localhost:3000"
). Allows for backend to accept requests from the frontend url.NEXT_PUBLIC_API_BASE_URL
field infrontend/.env
(Ex.NEXT_PUBLIC_API_BASE_URL="http://localhost:4000"
). URL prefix for sending requests to the backendTesting
Tested empty fields, incorrect phone number lengths, invalid emails.
Error messages appear as alerts.
To assist with testing, I would recommend commenting out the
reset()
function on line 74 offrontend/src/components/StudentFormButton.tsx
on the local branch so that the form doesnt reset every timeConfirmation of Change