diff --git a/api/services/medications/index.js b/api/services/medications/index.js index c40f056..80f526f 100644 --- a/api/services/medications/index.js +++ b/api/services/medications/index.js @@ -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(JSON.parse(body)); + data = await databaseServices.getFullMedicationInformation(body); res.status(200); } catch (err) { data = { Error: err?.message }; diff --git a/api/services/operations/helpers/medications.js b/api/services/operations/helpers/medications.js index 4b60f91..3edf033 100644 --- a/api/services/operations/helpers/medications.js +++ b/api/services/operations/helpers/medications.js @@ -89,7 +89,7 @@ export const medicationHelpers = { ]); const fullMedicationInformation = { - ...medInformation + ...medInformation[0] }; medRoutes?.forEach((row) => {