fix: add file to create and update local operations

This commit is contained in:
Dan Ribbens
2021-01-29 12:25:39 -05:00
parent 1358a35580
commit 51c021d3be
2 changed files with 8 additions and 0 deletions

View File

@@ -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<Document> {
@@ -23,6 +25,7 @@ export default async function create(options: Options): Promise<Document> {
overrideAccess = true,
disableVerificationEmail,
showHiddenFields,
file,
} = options;
const collection = this.collections[collectionSlug];
@@ -40,6 +43,7 @@ export default async function create(options: Options): Promise<Document> {
locale,
fallbackLocale,
payload: this,
file,
},
});
}

View File

@@ -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<Document> {
@@ -23,6 +25,7 @@ export default async function update(options: Options): Promise<Document> {
user,
overrideAccess = true,
showHiddenFields,
file,
} = options;
const collection = this.collections[collectionSlug];
@@ -40,6 +43,7 @@ export default async function update(options: Options): Promise<Document> {
locale,
fallbackLocale,
payload: this,
file,
},
};