feat: Note deletion logic and refactoring, #12551

This commit is contained in:
Julian Lam
2024-05-09 15:48:58 -04:00
parent fdba684049
commit ccd187e000
9 changed files with 238 additions and 12 deletions

View File

@@ -90,8 +90,8 @@ middleware.validate = async function (req, res, next) {
};
middleware.resolveObjects = async function (req, res, next) {
const { object } = req.body;
if (typeof object === 'string' || (Array.isArray(object) && object.every(o => typeof o === 'string'))) {
const { type, object } = req.body;
if (type !== 'Delete' && (typeof object === 'string' || (Array.isArray(object) && object.every(o => typeof o === 'string')))) {
winston.verbose('[middleware/activitypub] Resolving object(s)...');
try {
req.body.object = await activitypub.helpers.resolveObjects(object);