From d92167206f91a725ec859b0a6f25fcb24918ed80 Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Fri, 19 Apr 2024 20:14:15 +0200 Subject: [PATCH] fix: update existing repos --- server/api/forges/[forge_id]/repos/add.post.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/api/forges/[forge_id]/repos/add.post.ts b/server/api/forges/[forge_id]/repos/add.post.ts index fd93935..c8710cb 100644 --- a/server/api/forges/[forge_id]/repos/add.post.ts +++ b/server/api/forges/[forge_id]/repos/add.post.ts @@ -27,11 +27,11 @@ export default defineEventHandler(async (event) => { const repo = await db .insert(repoSchema) .values({ + remoteId: forgeRepo.id.toString(), + forgeId: forgeRepo.forgeId, name: forgeRepo.name, cloneUrl: forgeRepo.cloneUrl, - remoteId: forgeRepo.id.toString(), url: forgeRepo.url, - forgeId: forgeRepo.forgeId, defaultBranch: forgeRepo.defaultBranch, avatarUrl: forgeRepo.avatarUrl, }) @@ -41,6 +41,8 @@ export default defineEventHandler(async (event) => { name: forgeRepo.name, cloneUrl: forgeRepo.cloneUrl, url: forgeRepo.url, + defaultBranch: forgeRepo.defaultBranch, + avatarUrl: forgeRepo.avatarUrl, }, }) .returning()