Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
refactor: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Dec 13, 2023
1 parent 5f18483 commit ee51fb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .netlify/functions/webhooks/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Context, createProbot } from "probot";
import app from "../../../src/main";
const probot = createProbot();
const loadingApp = probot.load(app);
export async function handler(event, context: Context) {
export async function handler(event, _context: Context) {
try {
await loadingApp;
await probot.webhooks.verifyAndReceive({
Expand All @@ -12,9 +12,9 @@ export async function handler(event, context: Context) {
signature: event.headers["X-Hub-Signature-256"] || event.headers["x-hub-signature-256"] || "",
payload: JSON.parse(event.body),
});
return { statusCode: 200, body: '{"ok":true}' };
return { statusCode: 200 }; // Success response
} catch (error) {
console.error(error);
return { statusCode: error.status || 500, error: "ooops" };
return { statusCode: error.status || 500 }; // Error response
}
}

0 comments on commit ee51fb8

Please sign in to comment.