Skip to content

Node.js based forum software built for the modern web

fix: bug where post associations are not shown when the directory is `files`

Julian Lam7f870beb5918
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));