refactor: thumbs.associate accepts both relative path and url in path arg

This commit is contained in:
Julian Lam
2021-02-12 17:11:32 -05:00
parent 36e8d251c8
commit 3e6640efb2
2 changed files with 8 additions and 9 deletions

View File

@@ -130,8 +130,7 @@ Topics.addThumb = async (req, res) => {
await Promise.all(files.map(async (fileObj) => {
await topics.thumbs.associate({
id: req.params.tid,
path: fileObj.path || null,
url: fileObj.url,
path: fileObj.path || fileObj.url,
});
}));
}