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

isekai-main
Julian Lam 3 years ago
parent d90fc18bf1
commit 7f870beb59

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

Loading…
Cancel
Save