Add parse
This commit is contained in:
parent
2a87dd5954
commit
b143ee05b6
2 changed files with 3 additions and 2 deletions
|
|
@ -35,7 +35,7 @@ medicationRouter.post('/full/', async (req, res) => {
|
|||
const body = req?.body;
|
||||
try {
|
||||
await fullMedicationInformationSchema.validate(body);
|
||||
data = await databaseServices.getFullMedicationInformation(body?.drugId);
|
||||
data = await databaseServices.getFullMedicationInformation(JSON.parse(body));
|
||||
res.status(200);
|
||||
} catch (err) {
|
||||
data = { Error: err?.message };
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue