Skip to content

Commit

Permalink
Fix Invalid "role" field message
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoSwirl committed Jun 22, 2024
1 parent 7b3ca1b commit 3843481
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/tools/people/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const actions = {
if (!name) throw error(400, 'Missing "name" field.');
if (!email) throw error(400, 'Missing "email" field.');
if (!role) throw error(400, 'Missing "role" field.');
if (!(role.toString() in roles)) throw error(400, 'Invalid "role" field');
if (!(roles as readonly string[]).includes(role.toString()))
throw error(400, 'Invalid "role" field');

try {
await addPerson(name.toString(), email.toString(), role as RoleString, teamAffiliated);
Expand Down

0 comments on commit 3843481

Please sign in to comment.