Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/controller/registry-org.controller/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ class RegistryOrgControllerError extends idrErr.IDRError {
err.message = 'The requested user can not be created and added to the organization because the organization has hit its limit of 100 users. Contact the Secretariat.'
return err
}

invalidConversationObject () {
const err = {}
err.error = 'BAD_INPUT'
err.message = 'Parameters were invalid: conversation must be an object with a body.'
return err
}
}

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ async function updateOrg (req, res, next) {
let updatedOrg
let jointApprovalRequired

if (conversation && (typeof conversation !== 'object' || !conversation.body)) {
return res.status(400).json(error.invalidConversationObject())
}

try {
session.startTransaction()
const isSecretariat = await repo.isSecretariatByShortName(req.ctx.org, { session })
Expand Down
Loading