minor
This commit is contained in:
@@ -130,16 +130,10 @@ const userController = {
|
|||||||
await event.setTags([])
|
await event.setTags([])
|
||||||
if (body.tags) {
|
if (body.tags) {
|
||||||
await Tag.bulkCreate(body.tags.map(t => ({ tag: t })), { ignoreDuplicates: true })
|
await Tag.bulkCreate(body.tags.map(t => ({ tag: t })), { ignoreDuplicates: true })
|
||||||
const tags = await Tag.findAll({ where: { tag: { [Op.eq]: body.tags } } })
|
const tags = await Tag.findAll({ where: { tag: { [Op.in]: body.tags } } })
|
||||||
await event.addTags(tags)
|
await event.addTags(tags)
|
||||||
}
|
}
|
||||||
const newEvent = await Event.findByPk(event.id, { include: [User, Tag, Place] })
|
const newEvent = await Event.findByPk(event.id, { include: [User, Tag, Place] })
|
||||||
// check if bot exists
|
|
||||||
if (req.user.mastodon_auth) {
|
|
||||||
const post = await bot.post(req.user, newEvent)
|
|
||||||
event.activitypub_id = post.id
|
|
||||||
await event.save()
|
|
||||||
}
|
|
||||||
return res.json(newEvent)
|
return res.json(newEvent)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user