Support Metadata in GridFSAdapter (#6660)
* Support Metadata in GridFSAdapter * Useful for testing in the JS SDK * Adds new endpoint to be used with `Parse.File.getData` * Allows file adapters to return tags as well as future data. * fix tests * Make getMetadata optional * Revert "fix tests" This reverts commit 7706da13c688027483974e854b5b24321fb070cd. * improve coverage
This commit is contained in:
@@ -45,6 +45,13 @@ export class FilesController extends AdaptableController {
|
||||
return this.adapter.deleteFile(filename);
|
||||
}
|
||||
|
||||
getMetadata(filename) {
|
||||
if (typeof this.adapter.getMetadata === 'function') {
|
||||
return this.adapter.getMetadata(filename);
|
||||
}
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
/**
|
||||
* Find file references in REST-format object and adds the url key
|
||||
* with the current mount point and app id.
|
||||
@@ -52,7 +59,7 @@ export class FilesController extends AdaptableController {
|
||||
*/
|
||||
expandFilesInObject(config, object) {
|
||||
if (object instanceof Array) {
|
||||
object.map(obj => this.expandFilesInObject(config, obj));
|
||||
object.map((obj) => this.expandFilesInObject(config, obj));
|
||||
return;
|
||||
}
|
||||
if (typeof object !== 'object') {
|
||||
|
||||
Reference in New Issue
Block a user