fix(api): fix replaceOrUpdateContent
call not matching the required signature
This commit is contained in:
parent
2aae7ea2c4
commit
b782522f33
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user