Closed samau3 closed 4 months ago
Thanks for the feedback @francisli!
return all the attributes of the corresponding object (id, name, type, system, code, etc) so that the caller has everything they might need.
I've updated all the three routes to return all attributes instead of just the name
.
For the pagination, you're manually specifying the take parameter, doing the count, and formatting a string with the results. However, there are some pagination helpers that have since been added into the codebase that you can use
See
server/routes/api/v1/users/list.js
for an example of how these helpers are used. The query helper is inserver/prisma/client.js
and the response helper (which sets the pagination values in headers) is inserver/plugins/pagination.js
.
I've updated the routes to use the helpers rather than the manual formatting I had before.
Closes #45.
This PR creates three protected routes that correspond to querying the allergy, medication, and condition tables of the database.