Add parse (#30)

* Add parse

* Fix Errors
This commit is contained in:
Matt DiMeglio 2026-01-23 01:21:47 -05:00 committed by GitHub
parent 2a87dd5954
commit 96df444d8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -33,9 +33,10 @@ medicationRouter.get('/base/', async (req, res) => {
medicationRouter.post('/full/', async (req, res) => {
let data;
const body = req?.body;
try {
await fullMedicationInformationSchema.validate(body);
data = await databaseServices.getFullMedicationInformation(body?.drugId);
data = await databaseServices.getFullMedicationInformation(body);
res.status(200);
} catch (err) {
data = { Error: err?.message };

View file

@ -89,7 +89,7 @@ export const medicationHelpers = {
]);
const fullMedicationInformation = {
...medInformation
...medInformation[0]
};
medRoutes?.forEach((row) => {

View file

@ -21,7 +21,8 @@ const getBaseMedications = async () => {
}
}
const getFullMedicationInformation = async (drugId) => {
const getFullMedicationInformation = async (drug) => {
const { drugId } = drug;
try {
const dataResp = medicationHelpers.getFullMedicationInformation(drugId);
return dataResp;