confirm each tag in auth event
This commit is contained in:
@@ -307,7 +307,7 @@ const eventController = {
|
||||
if (body.tags) {
|
||||
await Tag.bulkCreate(body.tags.map(t => ({ tag: t, confirmed: !!req.user })), { ignoreDuplicates: true })
|
||||
const tags = await Tag.findAll({ where: { tag: { [Op.in]: body.tags } } })
|
||||
await Promise.all(tags.map(t => t.update({ weigth: Number(t.weigth) + 1 })))
|
||||
await Promise.all(tags.map(t => t.update({ weigth: Number(t.weigth) + 1, confirmed: true })))
|
||||
await event.addTags(tags)
|
||||
event.tags = tags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user