Merge branch 'refactor/error_and_api_handling' of github.com:open-reception/appointment-booking-software into refactor/error_and_api_handling

This commit is contained in:
Hendrik Belitz
2025-09-16 17:20:47 +02:00
3 changed files with 3 additions and 3 deletions
@@ -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);
@@ -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);
@@ -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);