fix tags for new images
This commit is contained in:
parent
57a1e9f24d
commit
b88321bb1b
2 changed files with 4 additions and 2 deletions
|
|
@ -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));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -182,7 +182,8 @@ app.post('/api/upload', (req, res): void => {
|
|||
})
|
||||
|
||||
if (req.body.tags) {
|
||||
setImageTags(db, imageId as number, req.body.tags)
|
||||
const tags = req.body.tags.split(',').filter((tag: string) => !!tag)
|
||||
setImageTags(db, imageId as number, tags)
|
||||
}
|
||||
|
||||
res.send(Images.imageFromDb(db, imageId as number))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue