Skip to content

Commit d787c9b

Browse files
committed
use shared webhook error response
1 parent 46e7892 commit d787c9b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • supabase/functions/send-email-for-new-chat-message

supabase/functions/send-email-for-new-chat-message/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ const handler = async (_request: Request): Promise<Response> => {
3535
}
3636

3737
if (_request.headers.get("x-peels-webhook-secret") !== webhookSecret) {
38-
return new Response(JSON.stringify({ error: "Unauthorized" }), {
39-
status: 401,
40-
headers: { "Content-Type": "application/json" },
41-
});
38+
return jsonResponse({ error: "Unauthorized" }, 401);
4239
}
4340

4441
// Prepare data

0 commit comments

Comments
 (0)