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

This commit is contained in:
Julian Lam
2022-06-10 14:32:43 -04:00
parent d90fc18bf1
commit 7f870beb59

View File

@@ -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));