mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
fix response error return type
This commit is contained in:
parent
460200dfef
commit
8083482ba8
12 changed files with 23 additions and 25 deletions
|
|
@ -47,7 +47,7 @@ export async function POST(request: Request, { params }: { params: Promise<{ pix
|
|||
return Response.json(pixel);
|
||||
} catch (e: any) {
|
||||
if (e.message.toLowerCase().includes('unique constraint') && e.message.includes('slug')) {
|
||||
return badRequest('That slug is already taken.');
|
||||
return badRequest({ message: 'That slug is already taken.' });
|
||||
}
|
||||
|
||||
return serverError(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue