Add folderPath to model items
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user