Skip to content

Commit 5e989ed

Browse files
committed
fixing more return values
1 parent 5752b8a commit 5e989ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/controller/org.controller/org.controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,15 +657,15 @@ async function updateOrg (req, res, next) {
657657
if (isRegistry) {
658658
const regAgt = setAggregateRegistryOrgObj({ short_name: newShortNameForAggregation })
659659
finalOrgState = (await regOrgRepo.aggregate(regAgt, { session }))[0] || null
660-
responseMessage = { message: `${orgToUpdate.short_name} was successfully updated.`, updated: finalOrgState } // Clarify message
661-
payload = { action: 'update_org', change: `${orgToUpdate.short_name} was successfully updated.`, org: finalOrgState }
660+
responseMessage = { message: `${orgToUpdate.short_name} organization was successfully updated.`, updated: finalOrgState } // Clarify message
661+
payload = { action: 'update_org', change: `${orgToUpdate.short_name} organization was successfully updated.`, org: finalOrgState }
662662
payload.user_UUID = await userRegistryRepo.getUserUUID(req.ctx.user, regOrgToUpdate.UUID, { session })
663663
payload.org_UUID = regOrgToUpdate.UUID
664664
} else {
665665
const legAgt = setAggregateOrgObj({ short_name: newShortNameForAggregation })
666666
finalOrgState = (await orgRepo.aggregate(legAgt, { session }))[0] || null
667-
responseMessage = { message: `${orgToUpdate.short_name} was successfully updated.`, updated: finalOrgState } // Clarify message
668-
payload = { action: 'update_org', change: `${orgToUpdate.short_name} was successfully updated.`, org: finalOrgState }
667+
responseMessage = { message: `${orgToUpdate.short_name} organization was successfully updated.`, updated: finalOrgState } // Clarify message
668+
payload = { action: 'update_org', change: `${orgToUpdate.short_name} organization was successfully updated.`, org: finalOrgState }
669669
payload.user_UUID = await userRepo.getUserUUID(req.ctx.user, orgToUpdate.UUID, { session })
670670
payload.org_UUID = orgToUpdate.UUID
671671
}

src/controller/org.controller/org.middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function validateUpdateOrgParameters () {
196196
for (const validation of validations) {
197197
const result = await validation.run(req)
198198
if (!result.isEmpty()) {
199-
return res.status(400).json({ errors: result.array() })
199+
return res.status(400).json({ message: 'Parameters were invalid', errors: result.array() })
200200
}
201201
}
202202
next()

0 commit comments

Comments
 (0)