Skip to content

Commit 0cd02e4

Browse files
committed
init
1 parent 042367c commit 0cd02e4

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

packages/backend/server/routes/webhook.post.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,33 +73,11 @@ export default eventHandler(async (event) => {
7373
const prDataHash = hash(key);
7474
if (prMarkEvents.includes(payload.action)) {
7575
await pullRequestNumbersBucket.setItem(prDataHash, payload.number);
76-
} else if (payload.action === "closed") {
77-
await pullRequestNumbersBucket.removeItem(prDataHash);
78-
79-
const baseKey = `${owner}:${repo}`;
80-
const cursorKey = `${baseKey}:${payload.number}`;
81-
82-
await cursorBucket.removeItem(cursorKey);
8376
}
8477
};
8578

86-
const branchDeletionHandler: HandlerFunction<"delete", unknown> = async ({
87-
payload,
88-
}) => {
89-
const [owner, repo] = payload.repository.full_name.split("/");
90-
91-
const baseKey = `${owner}:${repo}`;
92-
const cursorKey = `${baseKey}:${payload.ref}`;
93-
94-
await cursorBucket.removeItem(cursorKey);
95-
}
96-
97-
9879
app.webhooks.on("workflow_run", workflowHandler);
9980
app.webhooks.on("pull_request", pullRequestHandler);
100-
app.webhooks.on("delete", branchDeletionHandler)
101-
// TODO: create branch cursors on create
102-
// app.webhooks.on("create", branchDeletionHandler)
10381

10482
type EmitterWebhookEvent = Parameters<
10583
typeof app.webhooks.receive | typeof app.webhooks.verifyAndReceive
@@ -135,6 +113,5 @@ export default eventHandler(async (event) => {
135113
} finally {
136114
app.webhooks.removeListener("workflow_run", workflowHandler);
137115
app.webhooks.removeListener("pull_request", pullRequestHandler);
138-
app.webhooks.removeListener("delete", branchDeletionHandler);
139116
}
140117
});

0 commit comments

Comments
 (0)