diff --git a/src/controllers/responsiblepartyconsent.ts b/src/controllers/responsiblepartyconsent.ts index e61759e..2961168 100644 --- a/src/controllers/responsiblepartyconsent.ts +++ b/src/controllers/responsiblepartyconsent.ts @@ -48,6 +48,7 @@ export class ResponsiblePartyConsentController { try { const schema = Joi.object().keys({ bodytext: Joi.string().required().label("Body Text"), + type: Joi.string().required().label("Type"), }); let param: any = await schema.validateAsync(req.body); @@ -63,6 +64,7 @@ export class ResponsiblePartyConsentController { let responsiblepartyconsent = new ResponsiblePartyConsent(); responsiblepartyconsent.body = param.bodytext; + responsiblepartyconsent.type = param.type; responsiblepartyconsent.created_by = req.auth?.data.name; responsiblepartyconsent.updated_by = req.auth?.data.name; await queryRunner.manager.save(responsiblepartyconsent); @@ -93,16 +95,18 @@ export class ResponsiblePartyConsentController { const schema = Joi.object().keys({ id: Joi.string().uuid().required().label("Room ID"), bodytext: Joi.string().required().label("Body Text"), + type: Joi.string().required().label("Type"), }); let param: any = await schema.validateAsync(req.body); let responsiblepartyconsent = await OrmHelper.DB.getRepository(ResponsiblePartyConsent) - .createQueryBuilder("Room") - .where("Room.id = :id", { id: param.id }) + .createQueryBuilder("ResponsiblePartyConsent") + .where("ResponsiblePartyConsent.id = :id", { id: param.id }) .getOne(); if (!responsiblepartyconsent) throw { message: "Responsible Party Consent " + Language.lang.failed_not_found }; responsiblepartyconsent.body = param.bodytext; + responsiblepartyconsent.type = param.type; responsiblepartyconsent.updated_by = req.auth?.data.name; responsiblepartyconsent.updated_at = moment().toDate(); await queryRunner.manager.save(responsiblepartyconsent); diff --git a/src/swagger/builder.js b/src/swagger/builder.js index ac2d4d9..b8d7c3d 100644 --- a/src/swagger/builder.js +++ b/src/swagger/builder.js @@ -496,6 +496,7 @@ const doc = { }, responsiblepartyconsent: { $bodytext: "string", + $type: "string", }, }, parameters: {},