mirror of
https://github.com/strapi/strapi.git
synced 2025-07-22 00:17:15 +00:00
16 lines
287 B
JavaScript
16 lines
287 B
JavaScript
'use strict';
|
|
|
|
const folderModel = 'plugin::upload.folder';
|
|
|
|
const getFolderPath = async folderId => {
|
|
if (!folderId) return '/';
|
|
|
|
const parentFolder = await strapi.entityService.findOne(folderModel, folderId);
|
|
|
|
return parentFolder.path;
|
|
};
|
|
|
|
module.exports = {
|
|
getFolderPath,
|
|
};
|