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

#49 routes and controllers for CRUD #62

Merged
merged 8 commits into from
Oct 11, 2023

Conversation

leoleader
Copy link

@leoleader leoleader commented Oct 10, 2023

Changes

  • Added route and controller for getDataByDataType
  • Added route and controller for getAllDataTypes
  • Added route and controller for getAllSystems
  • Added route and controller for getAllRuns
  • added the above to index.ts
  • added try catches to controllers for proper error handling
  • updated NotFoundError in Odyssey-Base from class to function

Testing

  • Manually tested using Postman each route that the request goes through and returns [] since there is nothing in the database rn
  • For getDatayDataType, receives 404 response with custom error message

Screenshots

Screen Shot 2023-10-09 at 10 22 04 PM Screen Shot 2023-10-09 at 10 22 37 PM Screen Shot 2023-10-09 at 10 22 19 PM Screen Shot 2023-10-09 at 10 22 13 PM Screen Shot 2023-10-09 at 10 22 26 PM Screen Shot 2023-10-10 at 9 12 20 PM

Notes

  • Rn checks not successful because need to update submodule Odyssey-Base with changes I made to NotFoundError by merging PR I made (at least I think this is the way to do this i could be wrong)
  • Minor Change, in order for the body of req to be read as json and not undefined I needed to make a minor change and move app.use(express.json) higher in the index.ts, before the app.use routes.

Closes #49, #50, #52

@leoleader leoleader marked this pull request as ready for review October 10, 2023 16:42
Copy link
Contributor

@Peyton-McKee Peyton-McKee left a comment

Choose a reason for hiding this comment

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

nice job on these, just make sure to use the next function instead of the res

scylla-server/src/controllers/data.controller.ts Outdated Show resolved Hide resolved
scylla-server/src/controllers/data.controller.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Peyton-McKee Peyton-McKee left a comment

Choose a reason for hiding this comment

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

nice job

@Peyton-McKee Peyton-McKee merged commit d9c8adc into main Oct 11, 2023
4 checks passed
@Peyton-McKee Peyton-McKee deleted the 49-crud-add-route-and-controllers-for-systems branch October 11, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants