admin add block user from fedi
This commit is contained in:
parent
f9bb8bdc0e
commit
911a06dd18
1 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue