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

Added endpoints for events table #28

Merged
merged 6 commits into from
Jan 14, 2025
Merged

Added endpoints for events table #28

merged 6 commits into from
Jan 14, 2025

Conversation

antsuh1028
Copy link

Description

Added the api endpoints

Screenshots/Media

image

Issues

Closes #21

Copy link
Collaborator

@jessieh9 jessieh9 left a comment

Choose a reason for hiding this comment

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

Hey @antsuh1028 @dnarimot, there are a few edits that need to be made. We'll go over this at the sprint meeting tomorrow so don't worry about it yet!

Double-check this file for the input and output data for each request.

Todo:

  • Remember to export the router for use in app.ts and that way we can have the endpoints of the router in app.ts already start with '/events' and then in events.js the endpoint can just be /
    • You can also access our database and test the routes on Postman.
  • Fix "POST /events"
    - Only return the ID of event created, not all data
    - Additionally, description is optional, so ensure that the POST request works even if that is null.
  • Fix "PUT /events"
    - The logic for the endpoint is right, but we need to ensure that if there are NULL values passed in that the PUT doesn't directly update the table with NULL, but instead keeps the old value.

@antsuh1028 antsuh1028 closed this Jan 10, 2025
@antsuh1028 antsuh1028 reopened this Jan 10, 2025
@antsuh1028
Copy link
Author

Okay, I got the changes to work, tested in Postman, thank you.

@theNatePi
Copy link
Collaborator

Thank you! Will take another look this weekend.

@jessieh9
Copy link
Collaborator

jessieh9 commented Jan 13, 2025

TL's To-do

  • Import event router into the app.js
  • Use coalesce for PUT instead of 2 DB requests

jessieh9
jessieh9 previously approved these changes Jan 14, 2025
@jessieh9 jessieh9 merged commit 67d0d42 into main Jan 14, 2025
1 check passed
@theNatePi theNatePi deleted the create-endpoint-1 branch January 14, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create endpoints 1
4 participants