fix: handled api error responses

This commit is contained in:
Riccardo
2023-12-17 19:17:32 +01:00
parent a9b2c94cff
commit 5118f55c0c
7 changed files with 27 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ export async function POST(request: Request) {
});
const message: z.infer<typeof ResponseSchema> = {
success: true,
message: `Thank you for confirming the subscription, ${user.email}!`
};
@@ -35,7 +36,8 @@ export async function POST(request: Request) {
}
const message: z.infer<typeof ResponseSchema> = {
message: `Nothing to see here...`
success: false,
message: `It was not possible to confirm the subscription.`
};
return ApiResponse(200, JSON.stringify(message));