Explorar el Código

fix: upload hierarchy error

Nick hace 6 años
padre
commit
eedd1c0707
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      server/controllers/upload.js

+ 1 - 1
server/controllers/upload.js

@@ -74,7 +74,7 @@ router.post('/u', multer({
   }
 
   // Check if user can upload at path
-  const assetPath = (folderId) ? opts.hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
+  const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
   if (!WIKI.auth.checkAccess(req.user, ['write:assets'], { path: assetPath })) {
     return res.status(403).json({
       succeeded: false,