fix(api): fix replaceOrUpdateContent call not matching the required signature

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-11-11 17:21:17 -05:00
parent 2aae7ea2c4
commit b782522f33
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

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