keep going with federation
This commit is contained in:
@@ -5,12 +5,14 @@ module.exports = {
|
||||
async boost (req, res) {
|
||||
const event_id = req.body.object.match(`${config.baseurl}/federation/m/(.*)`)[1]
|
||||
const event = await Event.findByPk(event_id)
|
||||
if (!event) return res.status(404).send('Event not found!')
|
||||
await event.update({ boost: [...event.boost, req.body.actor]})
|
||||
res.sendStatus(201)
|
||||
},
|
||||
async like (req, res) {
|
||||
const event_id = req.body.object.match(`${config.baseurl}/federation/m/(.*)`)[1]
|
||||
const event = await Event.findByPk(event_id)
|
||||
if (!event) return res.status(404).send('Event not found!')
|
||||
await event.update({ likes: [...event.likes, req.body.actor]})
|
||||
res.sendStatus(201)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user