From 51c021d3be962e25619843f0157d826c7c80f4cb Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Fri, 29 Jan 2021 12:25:39 -0500 Subject: [PATCH] fix: add file to create and update local operations --- src/collections/operations/local/create.ts | 4 ++++ src/collections/operations/local/update.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/collections/operations/local/create.ts b/src/collections/operations/local/create.ts index 9d1d19b96b..7296c6f761 100644 --- a/src/collections/operations/local/create.ts +++ b/src/collections/operations/local/create.ts @@ -1,3 +1,4 @@ +import { UploadedFile } from 'express-fileupload'; import { Document } from '../../../types'; export type Options = { @@ -10,6 +11,7 @@ export type Options = { overrideAccess?: boolean disableVerificationEmail?: boolean showHiddenFields?: boolean + file?: UploadedFile } export default async function create(options: Options): Promise { @@ -23,6 +25,7 @@ export default async function create(options: Options): Promise { overrideAccess = true, disableVerificationEmail, showHiddenFields, + file, } = options; const collection = this.collections[collectionSlug]; @@ -40,6 +43,7 @@ export default async function create(options: Options): Promise { locale, fallbackLocale, payload: this, + file, }, }); } diff --git a/src/collections/operations/local/update.ts b/src/collections/operations/local/update.ts index bbf2bfb67e..a0a130f549 100644 --- a/src/collections/operations/local/update.ts +++ b/src/collections/operations/local/update.ts @@ -1,3 +1,4 @@ +import { UploadedFile } from 'express-fileupload'; import { Document } from '../../../types'; export type Options = { @@ -10,6 +11,7 @@ export type Options = { user?: Document overrideAccess?: boolean showHiddenFields?: boolean + file?: UploadedFile } export default async function update(options: Options): Promise { @@ -23,6 +25,7 @@ export default async function update(options: Options): Promise { user, overrideAccess = true, showHiddenFields, + file, } = options; const collection = this.collections[collectionSlug]; @@ -40,6 +43,7 @@ export default async function update(options: Options): Promise { locale, fallbackLocale, payload: this, + file, }, };