fix(AP): delete federated events

This commit is contained in:
lesion 2024-01-10 12:35:52 +01:00
parent 35c78882a2
commit 9de5773f0a
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -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)