foder route ok

This commit is contained in:
helori_ollivier
2026-04-24 23:28:53 +02:00
parent 6813dd23e1
commit 132b8cacd5
8 changed files with 91 additions and 36 deletions
+18
View File
@@ -0,0 +1,18 @@
const folder = require('../models/folder.model');
exports.getFoldersHierarchy = async (req, res) => {
const folders = await folder.findAll({
where: {
folderParent: null,
},
include: [
{
model: folder,
as: 'subFolders',
hierarchy: true,
}
]
});
res.json(folders);
}