if (user.Account.id === accountToBlock.id) {
res.status(409)
- .send({ error: 'You cannot block yourself.' })
- .end()
+ .json({ error: 'You cannot block yourself.' })
return
}
if (host === WEBSERVER.HOST) {
return res.status(409)
- .send({ error: 'You cannot block your own server.' })
- .end()
+ .json({ error: 'You cannot block your own server.' })
}
const server = await ServerModel.loadOrCreateByHost(host)
const accountBlock = await AccountBlocklistModel.loadByAccountAndTarget(accountId, targetAccountId)
if (!accountBlock) {
res.status(404)
- .send({ error: 'Account block entry not found.' })
- .end()
+ .json({ error: 'Account block entry not found.' })
return false
}
const serverBlock = await ServerBlocklistModel.loadByAccountAndHost(accountId, host)
if (!serverBlock) {
res.status(404)
- .send({ error: 'Server block entry not found.' })
- .end()
+ .json({ error: 'Server block entry not found.' })
return false
}