Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

update role to optional for user update

Francis Caoe1a5a610bb35
diff --git a/src/app/api/users/[userId]/route.ts b/src/app/api/users/[userId]/route.ts
index 09c77744f..d011783c4 100644
--- a/src/app/api/users/[userId]/route.ts
+++ b/src/app/api/users/[userId]/route.ts
@@ -26,7 +26,10 @@ export async function POST(request: Request, { params }: { params: Promise<{ use
const schema = z.object({
username: z.string().max(255),
password: z.string().max(255).optional(),
- role: z.string().regex(/admin|user|view-only/i),
+ role: z
+ .string()
+ .regex(/admin|user|view-only/i)
+ .optional(),
});
const { auth, body, error } = await parseRequest(request, schema);