[feat] manage unboost
This commit is contained in:
@@ -13,6 +13,15 @@ module.exports = {
|
||||
res.sendStatus(201)
|
||||
},
|
||||
|
||||
async unboost (req, res) {
|
||||
const match = req.body.object.match*`${config.baseurl}/federation/m/(.*)`)
|
||||
if (!match || match.length < 2) return res.status(404).send('Event not found!')
|
||||
debug('unboost %s', match[1])
|
||||
const event = await Event.findByPk(Number(match[1]))
|
||||
if (!event) return res.status(404).send('Event not found!')
|
||||
await event.update({ boost: [...event.boost.filter(actor => actor !== body.actor )]})
|
||||
},
|
||||
|
||||
async bookmark (req, res) {
|
||||
const match = req.body.object.match(`${config.baseurl}/federation/m/(.*)`)
|
||||
if (!match || match.length < 2) { return res.status(404).send('Event not found!') }
|
||||
|
||||
Reference in New Issue
Block a user