fix(api): page create
This commit is contained in:
parent
8edfd1c7ad
commit
52829bd127
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user