mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
minor
This commit is contained in:
parent
6ce01287e4
commit
ff6fc6fe23
2 changed files with 9 additions and 2 deletions
|
@ -95,6 +95,11 @@ module.exports = {
|
||||||
const APEvent = req.body?.object
|
const APEvent = req.body?.object
|
||||||
const ap_id = APEvent?.id ?? APEvent
|
const ap_id = APEvent?.id ?? APEvent
|
||||||
|
|
||||||
|
if (!res.locals.fedi_user.following) {
|
||||||
|
log.warn(`[FEDI] APUser not followed`)
|
||||||
|
return res.sendStatus(404)
|
||||||
|
}
|
||||||
|
|
||||||
if (!ap_id) {
|
if (!ap_id) {
|
||||||
return res.sendStatus(404)
|
return res.sendStatus(404)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ const log = require('../log')
|
||||||
const settingsController = require('../api/controller/settings')
|
const settingsController = require('../api/controller/settings')
|
||||||
const { DateTime } = require('luxon')
|
const { DateTime } = require('luxon')
|
||||||
const Helpers = require('./helpers')
|
const Helpers = require('./helpers')
|
||||||
|
const get = require('lodash/get')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
get (req, res) {
|
get (req, res) {
|
||||||
|
@ -108,9 +109,10 @@ module.exports = {
|
||||||
|
|
||||||
|
|
||||||
async remove (req, res) {
|
async remove (req, res) {
|
||||||
const ap_actor = await APUser.findOne({ where: { ap_id: get(req.body, 'object.id', req.body.object) }})
|
const ap_id = get(req.body, 'object.id', req.body.object)
|
||||||
|
const ap_actor = await APUser.findOne({ where: { ap_id }})
|
||||||
if (!ap_actor) {
|
if (!ap_actor) {
|
||||||
log.info(`[FEDI] Delete of unknown object ${get(req.body, 'object.id', req.body.object)}`)
|
log.info(`[FEDI] Delete of unknown object ${ap_id}`)
|
||||||
return res.status(404).send('Not found')
|
return res.status(404).send('Not found')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue