This commit is contained in:
Frank
2025-10-10 14:54:49 -04:00
parent ee846235f2
commit 4227b89ebc
3 changed files with 217 additions and 65 deletions

View File

@@ -58,8 +58,9 @@ export namespace User {
z.object({
email: z.string(),
role: z.enum(UserRole),
monthlyLimit: z.number().nullable().optional(),
}),
async ({ email, role }) => {
async ({ email, role, monthlyLimit }) => {
Actor.assertAdmin()
const workspaceID = Actor.workspace()
@@ -80,10 +81,12 @@ export namespace User {
}),
workspaceID,
role,
monthlyLimit,
})
.onDuplicateKeyUpdate({
set: {
role,
monthlyLimit,
timeDeleted: null,
},
}),