fix(AP): return a 201 on Create/Update/Delete

This commit is contained in:
lesion 2024-01-08 22:59:11 +01:00
parent 134c15f628
commit 4868c0af58
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 5 additions and 3 deletions

View file

@ -73,7 +73,7 @@ module.exports = {
await event.setTags(tags)
}
return event
return res.sendStatus(201)
},
@ -134,7 +134,7 @@ module.exports = {
await event.setTags(tags)
}
return event
return res.sendStatus(201)
},

View file

@ -79,6 +79,7 @@ module.exports = async (req, res) => {
} else {
// await Resources.create(req, res)
log.warn(`[FEDI] Create with unsupported Object or not a reply => ${message.object.type}`)
return res.sendStatus(404)
}
break
default:

View file

@ -13,7 +13,8 @@ module.exports = {
if (!events.length) { return }
log.info(`Remove ${events.length} past federated events`)
log.info(`Remove ${events.length} past federated events and related resources`)
await Resource.destroy({ where: { eventId: events.map(e => e.id) }})
await Event.destroy({
where: {