fix: sizes property optional on upload (#2066)
* omit 'sizes' when uploading files from the inferred collection type * cleanup * optional sizes on create and update, instead of omitted
This commit is contained in:
@@ -7,7 +7,7 @@ import { Collection } from '../../collections/config/types';
|
||||
|
||||
export type Arguments<T extends { [field: string | number | symbol]: unknown }> = {
|
||||
collection: Collection
|
||||
data: MarkOptional<T, 'id' | 'updatedAt' | 'createdAt'> & {
|
||||
data: MarkOptional<T, 'id' | 'updatedAt' | 'createdAt' | 'sizes'> & {
|
||||
email: string
|
||||
password: string
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Collection } from '../../config/types';
|
||||
import create from '../../operations/create';
|
||||
|
||||
export type Resolver<TSlug extends keyof GeneratedTypes['collections']> = (_: unknown, args: {
|
||||
data: MarkOptional<GeneratedTypes['collections'][TSlug], 'id' | 'updatedAt' | 'createdAt'>,
|
||||
data: Omit<MarkOptional<GeneratedTypes['collections'][TSlug], 'id' | 'updatedAt' | 'createdAt'>, 'sizes'>,
|
||||
locale?: string
|
||||
draft: boolean
|
||||
},
|
||||
|
||||
@@ -32,7 +32,7 @@ export type Arguments<T extends { [field: string | number | symbol]: unknown }>
|
||||
disableVerificationEmail?: boolean
|
||||
overrideAccess?: boolean
|
||||
showHiddenFields?: boolean
|
||||
data: MarkOptional<T, 'id' | 'createdAt' | 'updatedAt'>
|
||||
data: MarkOptional<T, 'id' | 'updatedAt' | 'createdAt' | 'sizes'>
|
||||
overwriteExistingFiles?: boolean
|
||||
draft?: boolean
|
||||
autosave?: boolean
|
||||
|
||||
@@ -13,7 +13,7 @@ import { APIError } from '../../../errors';
|
||||
|
||||
export type Options<TSlug extends keyof GeneratedTypes['collections']> = {
|
||||
collection: TSlug
|
||||
data: MarkOptional<GeneratedTypes['collections'][TSlug], 'id' | 'updatedAt' | 'createdAt'>
|
||||
data: MarkOptional<GeneratedTypes['collections'][TSlug], 'id' | 'updatedAt' | 'createdAt' | 'sizes'>
|
||||
depth?: number
|
||||
locale?: string
|
||||
fallbackLocale?: string
|
||||
|
||||
Reference in New Issue
Block a user