Fix fileupload defaults not applied (#7086)
* added fileUpload definition default value * added undefined and null as invalid * removed explicit default value reference * improved test grouping in describes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -250,11 +250,15 @@ export class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static validateFileUploadOptions(fileUpload) {
|
static validateFileUploadOptions(fileUpload) {
|
||||||
if (!fileUpload) {
|
try {
|
||||||
fileUpload = {};
|
if (fileUpload == null || typeof fileUpload !== 'object' || fileUpload instanceof Array) {
|
||||||
}
|
throw 'fileUpload must be an object value.';
|
||||||
if (typeof fileUpload !== 'object' || fileUpload instanceof Array) {
|
}
|
||||||
throw 'fileUpload must be an object value.';
|
} catch (e) {
|
||||||
|
if (e instanceof ReferenceError) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
if (fileUpload.enableForAnonymousUser === undefined) {
|
if (fileUpload.enableForAnonymousUser === undefined) {
|
||||||
fileUpload.enableForAnonymousUser = FileUploadOptions.enableForAnonymousUser.default;
|
fileUpload.enableForAnonymousUser = FileUploadOptions.enableForAnonymousUser.default;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -199,7 +199,8 @@ export interface ParseServerOptions {
|
|||||||
:DEFAULT: false */
|
:DEFAULT: false */
|
||||||
idempotencyOptions: ?IdempotencyOptions;
|
idempotencyOptions: ?IdempotencyOptions;
|
||||||
/* Options for file uploads
|
/* Options for file uploads
|
||||||
:ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS */
|
:ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS
|
||||||
|
:DEFAULT: {} */
|
||||||
fileUpload: ?FileUploadOptions;
|
fileUpload: ?FileUploadOptions;
|
||||||
/* Full path to your GraphQL custom schema.graphql file */
|
/* Full path to your GraphQL custom schema.graphql file */
|
||||||
graphQLSchema: ?string;
|
graphQLSchema: ?string;
|
||||||
|
|||||||
Reference in New Issue
Block a user