fix tags for new images

This commit is contained in:
Zutatensuppe 2021-06-03 00:01:42 +02:00
parent 57a1e9f24d
commit b88321bb1b
2 changed files with 4 additions and 2 deletions

View file

@ -2057,7 +2057,8 @@ app.post('/api/upload', (req, res) => {
created: Time.timestamp(),
});
if (req.body.tags) {
setImageTags(db, imageId, req.body.tags);
const tags = req.body.tags.split(',').filter((tag) => !!tag);
setImageTags(db, imageId, tags);
}
res.send(Images.imageFromDb(db, imageId));
});