Fix: Slot reservation only after successful email validation

- Move email validation before slot reservation in backend
- Remove duplicate frontend email validation
- Slots are no longer blocked by failed booking attempts
- Clean up unused email error UI components
- Ensure slots remain available if email validation fails
This commit is contained in:
2025-10-02 13:39:13 +02:00
parent 73cf733c5f
commit 5baa231d3c
5 changed files with 64 additions and 48 deletions

View File

@@ -21,10 +21,7 @@ rpcApp.all("/*", async (c) => {
} catch (error) {
console.error("RPC Handler error:", error);
// Preserve the original error message if it's a known error
const errorMessage = error instanceof Error ? error.message : "Internal server error";
const statusCode = error instanceof Error && error.message.includes("bereits eine Buchung") ? 400 : 500;
return c.json({ error: errorMessage }, statusCode);
// Let oRPC handle errors properly
throw error;
}
});