admin add block user from fedi

This commit is contained in:
les 2020-02-04 23:40:35 +01:00
parent f9bb8bdc0e
commit 911a06dd18

View file

@ -2,10 +2,14 @@ const { ap_user: APUser } = require('../models')
const apUserController = {
async toggleBlock (req, res) {
const user_id = req.body.user_id
const user = await APUser.findByPk(user_id)
await user.update({ blocked: !user.blocked })
res.json(user)
const ap_id = req.body.ap_id
try {
const user = await APUser.findByPk(ap_id)
await user.update({ blocked: !user.blocked })
res.json(user)
} catch (e) {
res.sendStatus(404)
}
}
}