fix: Consolidating Common Data Models#255
Conversation
|
@matt-franklin225 For your benefit, #300 is about to move the list of term names out into stdlib, which may have wider consequences. |
laggycomputer
left a comment
There was a problem hiding this comment.
You should apply your changes to the new dining API, then we should merge this before it gets too big.
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
|
Added new response helper functions to dining.ts in rest/routes, let me know if there's any other things I need to edit with regards to dining |
laggycomputer
left a comment
There was a problem hiding this comment.
Minor thing: isCursor should be an optional field in an object. Formal parameters with default values get messy if you ever want to have more than one.
|
Worth noting that I had overlooked a 400 response (of which there is currently only one) when creating the functions for routes. I used the response404 function for it since they work identically, but it's worth considering either making a new function called response400 (which would be redundant as it's the exact same as response404) or renaming response404. |
Good catch. We probably shouldn't have introduced a 400 to begin with. |
Description
Implemented the following changes to remove redundant code across the API codebase:
apps/api/src/rest/routes, adding these helpers intoapps/api/src/schema/base/response.ts.apps/api/src/schema/base. The base schemas are declared inapps/api/src/schema/base/search-modifiers.ts.Related Issue
Will close #142
Motivation and Context
This cleans up redundant code in the codebase, improving readability and adding helper functions and exported variables to improve future work.
How Has This Been Tested?
The changes have been tested on a local instance.
Types of changes
Checklist: