Skip to content

Commit

Permalink
fix revalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruwang committed Oct 1, 2024
1 parent e7b6dda commit a047d4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/github/hooks/installation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EmitterWebhookEvent } from "@octokit/webhooks";

import { sendInstallationDetails } from "../services/user";
import { githubCache } from "./cache";

type GitHubRepository = {
id: number;
Expand All @@ -15,6 +16,8 @@ export const onInstallationCreated = async (payload: EmitterWebhookEvent<"instal
const installationId = payload.installation.id;
const appId = payload.installation.app_id;
const repos = payload.repositories as GitHubRepository[];

repos.forEach((repo) => {
githubCache.revalidate({ repositoryId: repo.id });
});
await sendInstallationDetails(installationId, appId, repos, payload.installation);
};

0 comments on commit a047d4c

Please sign in to comment.