mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Convert teams api routes.
This commit is contained in:
parent
7d5556a637
commit
e51f182403
15 changed files with 354 additions and 4 deletions
|
|
@ -12,10 +12,14 @@ export function badRequest(message?: any) {
|
|||
return Response.json({ error: 'Bad request', message }, { status: 400 });
|
||||
}
|
||||
|
||||
export function unauthorized() {
|
||||
return Response.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
export function notFound(message?: any) {
|
||||
return Response.json({ error: 'Not found', message, status: 404 });
|
||||
}
|
||||
|
||||
export function serverError(error: any) {
|
||||
export function unauthorized(message?: any) {
|
||||
return Response.json({ error: 'Unauthorized', message }, { status: 401 });
|
||||
}
|
||||
|
||||
export function serverError(error?: any) {
|
||||
return Response.json({ error: 'Server error', message: serializeError(error), status: 500 });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ export const unitParam = z.string().refine(value => UNIT_TYPES.includes(value),
|
|||
message: 'Invalid unit',
|
||||
});
|
||||
|
||||
export const roleParam = z.string().regex(/team-member|team-view-only|team-manager/);
|
||||
|
||||
export const filterParams = {
|
||||
url: z.string().optional(),
|
||||
referrer: z.string().optional(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue