-
Notifications
You must be signed in to change notification settings - Fork 1
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
Amelia tomas/event schema #9
Conversation
scripts/eventTest.ts
Outdated
@@ -0,0 +1,39 @@ | |||
// TO RUN: npx ts-node scripts/eventTest.ts |
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.
Can you guys delete this file from the PR? I think ideally we wanna only keep files that the webapp will need (so omit testing files)
src/components/ExampleButton.tsx
Outdated
}, | ||
}, | ||
}); | ||
// const response2 = await deleteEvent({ |
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.
nit: remove the commented-out testing
src/app/api/event/route.client.ts
Outdated
// DateTime: Date; | ||
// }; | ||
export const addEvent = async (request: { | ||
body: { event: Partial<Event> }; |
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.
Instead of Partial I think we should use the Pick keyword in TypeScript so we can make things more specific like this:
type CreateEventInput = Pick<Event, "EventName" | "Description" | "MaxPeople" | "DateTime">
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.
Great work guys once you make the changes I wrote down feel free to merge!
Description
Created Event Schema, made the POST, PUT, and DELETE.
Issues
No issues!
Screenshots
Backend - no screenshots.
Test
Use the button.tsx to test our methods.
Possible Downsides
We weren't sure about the Partial Event on the client side.
Additional Documentations