Skip to content

Commit

Permalink
changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaFrncJrg committed Feb 11, 2025
1 parent 8f5eb7b commit 6613d86
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/xo-server/src/xo-mixins/rest-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,20 +1517,19 @@ export default class RestApi {

api.delete(
'/:collection(groups)/:id',
json(),
wrap(async (req, res) => {
const { id } = req.params
try {
await app.deleteGroup(id)
await app.deleteGroup(req.params.id)
res.sendStatus(204)
} catch (error) {
json({ error: error.message })
if (noSuchObject.is(error)) {
res.status(404)
} else {
res.status(500)
if (!noSuchObject.is(error) && !featureUnauthorized.is(error)) {
return res.status(500).json({ message: 'Internal server error' })
}

throw error
}
})
}, true)
)
}

Expand Down

0 comments on commit 6613d86

Please sign in to comment.