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) {
|
||||
if (!fileUpload) {
|
||||
fileUpload = {};
|
||||
}
|
||||
if (typeof fileUpload !== 'object' || fileUpload instanceof Array) {
|
||||
throw 'fileUpload must be an object value.';
|
||||
try {
|
||||
if (fileUpload == null || 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) {
|
||||
fileUpload.enableForAnonymousUser = FileUploadOptions.enableForAnonymousUser.default;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -199,7 +199,8 @@ export interface ParseServerOptions {
|
||||
:DEFAULT: false */
|
||||
idempotencyOptions: ?IdempotencyOptions;
|
||||
/* Options for file uploads
|
||||
:ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS */
|
||||
:ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS
|
||||
:DEFAULT: {} */
|
||||
fileUpload: ?FileUploadOptions;
|
||||
/* Full path to your GraphQL custom schema.graphql file */
|
||||
graphQLSchema: ?string;
|
||||
|
||||
Reference in New Issue
Block a user