diff --git a/server/api/story/[id]/[chapter]/index.put.ts b/server/api/story/[id]/[chapter]/index.put.ts index 2709ec7..3e94b14 100644 --- a/server/api/story/[id]/[chapter]/index.put.ts +++ b/server/api/story/[id]/[chapter]/index.put.ts @@ -4,7 +4,7 @@ import { messages } from "@server/constants"; import { storyQuerier } from "@server/dbHelpers"; import { isLoggedIn } from "@server/middlewareButNotReally"; import { canModify } from "@server/middlewareButNotReally/storyPrivileges"; -import { replaceOrUploadContent, bodyHandler } from "@server/storyHelpers"; +import { replaceOrUploadContent, bodyHandler, getBucket } from "@server/storyHelpers"; import { Story } from "@models/stories"; export default eventHandler(async (ev) => { @@ -20,7 +20,7 @@ export default eventHandler(async (ev) => { const cc: FormChapter = body.chapters[0]; const cid = story.chapters[ev.context.chapterIndex].id; const content = await bodyHandler(cc); - await replaceOrUploadContent(cid!, content); + await replaceOrUploadContent(cid!, content, getBucket()); let ns; try { ns = await Story.findOneAndUpdate(