diff --git a/src/models/DirectoryModel.js b/src/models/DirectoryModel.js index e1c084d30..bc00dbd9c 100644 --- a/src/models/DirectoryModel.js +++ b/src/models/DirectoryModel.js @@ -13,11 +13,14 @@ export function createDirectoryModel(origin, accessToken, appId) { return []; } - // if we have an image, attach previewUrl + // this prepares the entries to be compatible with all components result.body.entries.forEach(item => { + // if we have an image, attach previewUrl if (item.mimeType.indexOf('image/') === 0) { item.previewUrl = `${origin}/api/v1/apps/${appId}/files/${encodeURIComponent(path + '/' + item.fileName)}?access_token=${accessToken}` } + + item.folderPath = path; }); return result.body.entries;