Skip to content

Commit

Permalink
feat: use transaction when updating page blob
Browse files Browse the repository at this point in the history
  • Loading branch information
karrui committed Oct 2, 2024
1 parent 8409d36 commit b8363e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/studio/src/server/modules/page/page.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export const pageRouter = router({
updatePageBlob: protectedProcedure
.input(updatePageBlobSchema)
.mutation(async ({ input }) => {
await updateBlobById(db, { ...input, pageId: input.pageId })
await db.transaction().execute(async (tx) => {
return updateBlobById(tx, input)
})

return input
}),
Expand Down

0 comments on commit b8363e8

Please sign in to comment.