Add folderPath to model items

This commit is contained in:
Johannes Zellner
2023-04-02 10:41:02 +02:00
parent e2de107067
commit 9d6749ec42
+4 -1
View File
@@ -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;