fix(api): changelog commit upload
This commit is contained in:
parent
81baf571f9
commit
c6afa94e1e
@ -38,7 +38,6 @@ export const registerCommitCreate = (api: typeof changelogCommitApi) => {
|
|||||||
const userId = verifyAuthentication(c)
|
const userId = verifyAuthentication(c)
|
||||||
|
|
||||||
const data: z.infer<typeof CommitCreateInput> = await c.req.json()
|
const data: z.infer<typeof CommitCreateInput> = await c.req.json()
|
||||||
|
|
||||||
const changelogResult = await db.query.changelog.findFirst({
|
const changelogResult = await db.query.changelog.findFirst({
|
||||||
where: and(
|
where: and(
|
||||||
eq(changelog.id, data[0].changelogId),
|
eq(changelog.id, data[0].changelogId),
|
||||||
@ -54,9 +53,11 @@ export const registerCommitCreate = (api: typeof changelogCommitApi) => {
|
|||||||
...entry,
|
...entry,
|
||||||
createdAt: new Date(entry.author.date),
|
createdAt: new Date(entry.author.date),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const [result] = await db
|
const [result] = await db
|
||||||
.insert(changelog_commit)
|
.insert(changelog_commit)
|
||||||
.values(mappedData)
|
.values(mappedData)
|
||||||
|
.onConflictDoNothing()
|
||||||
.returning()
|
.returning()
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user