fix(api): page create

This commit is contained in:
Lars Hampe 2024-11-05 00:11:32 +01:00
parent 8edfd1c7ad
commit 52829bd127

View File

@ -42,7 +42,6 @@ export const registerPageCreate = (api: typeof pageApi) => {
const { changelogIds, ...rest }: z.infer<typeof PageCreateInput> = const { changelogIds, ...rest }: z.infer<typeof PageCreateInput> =
await c.req.json() await c.req.json()
const [result] = await db const [result] = await db
.insert(page) .insert(page)
.values({ .values({
@ -52,7 +51,7 @@ export const registerPageCreate = (api: typeof pageApi) => {
.returning() .returning()
// TODO: implement transaction // TODO: implement transaction
if (changelogIds) { if (changelogIds.length > 0) {
await db.insert(changelogs_to_pages).values( await db.insert(changelogs_to_pages).values(
changelogIds.map((changelogId) => ({ changelogIds.map((changelogId) => ({
changelogId, changelogId,