diff --git a/packages/plugin-riskassessment-api/src/messageBroker.ts b/packages/plugin-riskassessment-api/src/messageBroker.ts index b4cf7309cb..2b941deee5 100644 --- a/packages/plugin-riskassessment-api/src/messageBroker.ts +++ b/packages/plugin-riskassessment-api/src/messageBroker.ts @@ -25,6 +25,18 @@ export const initBroker = async cl => { }; } ); + + consumeRPCQueue( + 'riskassessment:riskAssessments.create', + async ({ subdomain, data }) => { + const models = await generateModels(subdomain); + + return { + data: await models.RiskAssessments.addRiskAssessment(data), + status: 'success' + }; + } + ); }; export const sendFormsMessage = async (