fix: Server error if non-array passed to users.invite

This commit is contained in:
Tom Moor
2021-06-07 20:28:28 -07:00
parent 4a8d357084
commit d8ca9c6111
3 changed files with 19 additions and 1 deletions

View File

@ -258,7 +258,7 @@ router.post("users.activate", auth(), async (ctx) => {
router.post("users.invite", auth(), async (ctx) => {
const { invites } = ctx.body;
ctx.assertPresent(invites, "invites is required");
ctx.assertArray(invites, "invites must be an array");
const { user } = ctx.state;
const team = await Team.findByPk(user.teamId);