From 7f870beb591844014193cad7283eeddb41f528c0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 10 Jun 2022 14:32:43 -0400 Subject: [PATCH] fix: bug where post associations are not shown when the directory is `files` --- src/controllers/admin/uploads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/admin/uploads.js b/src/controllers/admin/uploads.js index e0cdb34930..6c20300e17 100644 --- a/src/controllers/admin/uploads.js +++ b/src/controllers/admin/uploads.js @@ -46,7 +46,7 @@ uploadsController.get = async function (req, res, next) { }); // Add post usage info if in /files - if (['/files', '/files/'].includes(req.query.dir)) { + if (['files', '/files', '/files/'].includes(req.query.dir)) { const usage = await posts.uploads.getUsage(files); files.forEach((file, idx) => { file.inPids = usage[idx].map(pid => parseInt(pid, 10));