Skip to content

Commit 27f2bcd

Browse files
committed
Support non-voting admin member in API
1 parent 985750a commit 27f2bcd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/api/functions/organizations.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,15 @@ export const addLead = async ({
211211
{
212212
Put: {
213213
TableName: genericConfig.SigInfoTableName,
214-
Item: marshall({
215-
...user,
216-
primaryKey: `LEAD#${orgId}`,
217-
entryId: username,
218-
updatedAt: new Date().toISOString(),
219-
}),
214+
Item: marshall(
215+
{
216+
...user,
217+
primaryKey: `LEAD#${orgId}`,
218+
entryId: username,
219+
updatedAt: new Date().toISOString(),
220+
},
221+
{ removeUndefinedValues: true },
222+
),
220223
ConditionExpression:
221224
"attribute_not_exists(primaryKey) AND attribute_not_exists(entryId)",
222225
},

src/common/types/organizations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const orgLeadEntry = z.object({
99
(email) => email.endsWith('@illinois.edu'),
1010
{ message: 'Email must be from the @illinois.edu domain' }
1111
),
12-
title: z.optional(z.string())
12+
title: z.optional(z.string()),
13+
nonVotingMember: z.optional(z.boolean()).default(false)
1314
})
1415

1516
export const leadTitleSuggestions = ["Chair", "Co-chair", "Admin", "Lead", "Helper"];

0 commit comments

Comments
 (0)