From 6529271de24fb7b6ad2e3fecc22070525fd43702 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 31 May 2022 13:57:42 +0200 Subject: [PATCH] fix: GitHub fixes --- src/lib/database/gitSources.ts | 8 +------- src/routes/sources/[id]/_Github.svelte | 4 ++-- src/routes/sources/[id]/index.svelte | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/database/gitSources.ts b/src/lib/database/gitSources.ts index a0c0b94ed..bed676988 100644 --- a/src/lib/database/gitSources.ts +++ b/src/lib/database/gitSources.ts @@ -67,16 +67,10 @@ export async function getSource({ return body; } export async function addGitHubSource({ id, teamId, type, name, htmlUrl, apiUrl, organization }) { - await prisma.gitSource.update({ + return await prisma.gitSource.update({ where: { id }, data: { type, name, htmlUrl, apiUrl, organization } }); - return await prisma.githubApp.create({ - data: { - teams: { connect: { id: teamId } }, - gitSource: { connect: { id } } - } - }); } export async function addGitLabSource({ id, diff --git a/src/routes/sources/[id]/_Github.svelte b/src/routes/sources/[id]/_Github.svelte index 6d91f2699..b21640df1 100644 --- a/src/routes/sources/[id]/_Github.svelte +++ b/src/routes/sources/[id]/_Github.svelte @@ -80,7 +80,7 @@
- {#if !source.githubApp?.installationId} + {#if !source.githubAppId}
General
@@ -171,7 +171,7 @@ {:else}
-
diff --git a/src/routes/sources/[id]/index.svelte b/src/routes/sources/[id]/index.svelte index ffdd7d6a1..4b12fe1c6 100644 --- a/src/routes/sources/[id]/index.svelte +++ b/src/routes/sources/[id]/index.svelte @@ -113,7 +113,7 @@
- {#if !source.gitlabAppId && (!source.githubAppId || !source.githubApp?.installationId)} + {#if !source.gitlabAppId && !source.githubAppId}
Select a provider