mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
update role to optional for user update
This commit is contained in:
parent
2f77e15bbc
commit
e1a5a610bb
1 changed files with 4 additions and 1 deletions
|
|
@ -26,7 +26,10 @@ export async function POST(request: Request, { params }: { params: Promise<{ use
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
username: z.string().max(255),
|
username: z.string().max(255),
|
||||||
password: z.string().max(255).optional(),
|
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);
|
const { auth, body, error } = await parseRequest(request, schema);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue