From c6afa94e1ea26d994b8b6a24ea5ee0c41b8df253 Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Thu, 31 Oct 2024 20:35:52 +0100 Subject: [PATCH] fix(api): changelog commit upload --- apps/api/src/changelog/commit/create.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/changelog/commit/create.ts b/apps/api/src/changelog/commit/create.ts index a796bed..762876f 100644 --- a/apps/api/src/changelog/commit/create.ts +++ b/apps/api/src/changelog/commit/create.ts @@ -38,7 +38,6 @@ export const registerCommitCreate = (api: typeof changelogCommitApi) => { const userId = verifyAuthentication(c) const data: z.infer = await c.req.json() - const changelogResult = await db.query.changelog.findFirst({ where: and( eq(changelog.id, data[0].changelogId), @@ -54,9 +53,11 @@ export const registerCommitCreate = (api: typeof changelogCommitApi) => { ...entry, createdAt: new Date(entry.author.date), })) + const [result] = await db .insert(changelog_commit) .values(mappedData) + .onConflictDoNothing() .returning() if (!result) {