From e2467c97d37bca47f46aaf7bce0939cb884fb12d Mon Sep 17 00:00:00 2001 From: Hendrik Date: Tue, 16 Sep 2025 16:10:28 +0200 Subject: [PATCH 1/3] Update src/routes/api/tenants/[id]/appointments/[appointmentId]/cancel/+server.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../tenants/[id]/appointments/[appointmentId]/cancel/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/api/tenants/[id]/appointments/[appointmentId]/cancel/+server.ts b/src/routes/api/tenants/[id]/appointments/[appointmentId]/cancel/+server.ts index b262e6e..0a00fb0 100644 --- a/src/routes/api/tenants/[id]/appointments/[appointmentId]/cancel/+server.ts +++ b/src/routes/api/tenants/[id]/appointments/[appointmentId]/cancel/+server.ts @@ -116,7 +116,7 @@ export const PUT: RequestHandler = async ({ params, locals }) => { // Check if user is authenticated if (!tenantId || !appointmentId) { - throw new ValidationError("Tenant ID and appointment ID are required", 400); + throw new ValidationError("Tenant ID and appointment ID are required"); } checkPermission(locals, tenantId); From 782bb788d07facfa59b17a790c439a6fb3d68992 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Tue, 16 Sep 2025 16:10:46 +0200 Subject: [PATCH 2/3] Update src/routes/api/tenants/[id]/agents/[agentId]/absences/[absenceId]/+server.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../[id]/agents/[agentId]/absences/[absenceId]/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/api/tenants/[id]/agents/[agentId]/absences/[absenceId]/+server.ts b/src/routes/api/tenants/[id]/agents/[agentId]/absences/[absenceId]/+server.ts index 0b4ec94..9a230a9 100644 --- a/src/routes/api/tenants/[id]/agents/[agentId]/absences/[absenceId]/+server.ts +++ b/src/routes/api/tenants/[id]/agents/[agentId]/absences/[absenceId]/+server.ts @@ -340,7 +340,7 @@ export const GET: RequestHandler = async ({ params, locals }) => { // Check if user is authenticated if (!tenantId || !agentId || !absenceId) { - return new ValidationError("Missing tenant, agent, or absence ID").toJson(); + throw new ValidationError("Missing tenant, agent, or absence ID"); } checkPermission(locals, tenantId); From 95b5c939a94b3b7584422ffe6b75ae318dc161d0 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Tue, 16 Sep 2025 16:10:56 +0200 Subject: [PATCH 3/3] Update src/routes/api/tenants/[id]/channels/+server.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/routes/api/tenants/[id]/channels/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/api/tenants/[id]/channels/+server.ts b/src/routes/api/tenants/[id]/channels/+server.ts index 7e837cf..af29374 100644 --- a/src/routes/api/tenants/[id]/channels/+server.ts +++ b/src/routes/api/tenants/[id]/channels/+server.ts @@ -322,7 +322,7 @@ export const POST: RequestHandler = async ({ params, request, locals }) => { const tenantId = params.id; if (!tenantId) { - return json({ error: "No tenant id given" }, { status: 400 }); + throw new ValidationError(ERRORS.TENANTS.NO_TENANT_ID); } checkPermission(locals, tenantId, true);