Skip to content

Commit 6dc8d28

Browse files
OzgeAkindrew-gross
authored andcommitted
Option to ignore parse file storage (#2222)
* flag in configurations to use only files adapter * added lib folder * remove lib * alignment edit * replace comma with semicolon * ignore parse file storage if fileKey is not provided (undefined)
1 parent 1fb7679 commit 6dc8d28

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Controllers/FilesController.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ export class FilesController extends AdaptableController {
6464
// all filenames starting with "tfss-" should be from files.parsetfss.com
6565
// all filenames starting with a "-" seperated UUID should be from files.parse.com
6666
// all other filenames have been migrated or created from Parse Server
67-
if (filename.indexOf('tfss-') === 0) {
68-
fileObject['url'] = 'http://files.parsetfss.com/' + config.fileKey + '/' + encodeURIComponent(filename);
69-
} else if (legacyFilesRegex.test(filename)) {
70-
fileObject['url'] = 'http://files.parse.com/' + config.fileKey + '/' + encodeURIComponent(filename);
71-
} else {
67+
if (config.fileKey === undefined) {
7268
fileObject['url'] = this.adapter.getFileLocation(config, filename);
69+
} else {
70+
if (filename.indexOf('tfss-') === 0) {
71+
fileObject['url'] = 'http://files.parsetfss.com/' + config.fileKey + '/' + encodeURIComponent(filename);
72+
} else if (legacyFilesRegex.test(filename)) {
73+
fileObject['url'] = 'http://files.parse.com/' + config.fileKey + '/' + encodeURIComponent(filename);
74+
} else {
75+
fileObject['url'] = this.adapter.getFileLocation(config, filename);
76+
}
7377
}
7478
}
7579
}

src/ParseServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class ParseServer {
109109
dotNetKey,
110110
restAPIKey,
111111
webhookKey,
112-
fileKey = 'invalid-file-key',
112+
fileKey = undefined,
113113
facebookAppIds = [],
114114
enableAnonymousUsers = true,
115115
allowClientClassCreation = true,

0 commit comments

Comments
 (0)