From d6cb69ec3bcb27762284d0c32160199121e75cdd Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Sun, 10 Nov 2024 07:27:00 +0100 Subject: [PATCH] feat(api): return commits on version by id request --- apps/api/src/changelog/version/byId.ts | 3 +++ packages/schema/src/commit/base.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/changelog/version/byId.ts b/apps/api/src/changelog/version/byId.ts index 194a3dc..e0d6018 100644 --- a/apps/api/src/changelog/version/byId.ts +++ b/apps/api/src/changelog/version/byId.ts @@ -36,6 +36,9 @@ export const registerVersionById = (api: typeof changelogVersionApi) => { const versionResult = await db.query.changelog_version.findFirst({ where: eq(changelog_version.id, id), + with: { + commits: true, + }, }) if (!versionResult) { diff --git a/packages/schema/src/commit/base.ts b/packages/schema/src/commit/base.ts index ab11b9b..99d7534 100644 --- a/packages/schema/src/commit/base.ts +++ b/packages/schema/src/commit/base.ts @@ -25,6 +25,6 @@ export const CommitOutput = z email: z.string().email(), date: z.string(), }), - body: z.string().optional(), + body: z.string().optional().nullable(), }) .openapi('Commit')