mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix(AP): delete federated events
This commit is contained in:
parent
35c78882a2
commit
9de5773f0a
1 changed files with 7 additions and 2 deletions
|
@ -82,7 +82,12 @@ module.exports = {
|
|||
const APEvent = req.body?.object
|
||||
|
||||
// check if this event is new
|
||||
const ap_id = req.body.id
|
||||
const ap_id = APEvent?.id ?? APEvent
|
||||
|
||||
if (!ap_id) {
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
const event = await Event.findOne({ where: { ap_id }, include: [APUser]})
|
||||
if (!event) { return res.sendStatus(404)}
|
||||
|
||||
|
@ -147,7 +152,7 @@ module.exports = {
|
|||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
const event = await Event.findOne({ where: { ap_id: APEvent?.id ?? APEvent }, include: [APUser]})
|
||||
const event = await Event.findOne({ where: { ap_id }, include: [APUser]})
|
||||
if (!event) {
|
||||
log.error('[FEDI] Event not found: %s', APEvent?.id ?? APEvent)
|
||||
return res.sendStatus(404)
|
||||
|
|
Loading…
Reference in a new issue