Skip to content

Commit

Permalink
feat : test try for org repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Vswaroop04 committed Jul 13, 2024
1 parent b352f91 commit ca0b136
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions server/src/controllers/user/subscribeRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,13 @@ export const subscribeRepo = async (
const baseGithubUrl = parts.slice(0, 4).join('/');
const user = await getUserByGithubUrl(baseGithubUrl);
const repoName = parts[4].toLowerCase();
let webHook;
if (user) {
webHook = await addWebhookForPersonalRepo(
accessToken,
owner,
repoName,
REPO_WEBHOOK_URL,
);
} else {
webHook = await addWebhookForOrganizationRepo(
accessToken,
owner,
repoName,
REPO_WEBHOOK_URL,
);
}
let webHook = await addWebhookForPersonalRepo(
accessToken,
owner,
repoName,
REPO_WEBHOOK_URL,
);

if (!webHook) throw Error('Issue In Creating Webhook');
if (webHook.active) {
await updateRepoSubscription(baseGithubUrl, repoLink, req.body.token);
Expand Down

0 comments on commit ca0b136

Please sign in to comment.