test: refactor AP tests

This commit is contained in:
Julian Lam
2024-02-21 10:26:26 -05:00
parent e138b915b9
commit 42a0924137
3 changed files with 49 additions and 35 deletions

View File

@@ -27,7 +27,9 @@ Notes.assert = async (uid, input, options = {}) => {
await Promise.all(input.map(async (item) => {
let id = activitypub.helpers.isUri(item) ? item : item.pid;
id = await Notes.resolveId(uid, id);
if (activitypub.helpers.isUri(id)) {
id = await Notes.resolveId(uid, id);
}
const key = `post:${id}`;
const exists = await db.exists(key);
winston.verbose(`[activitypub/notes.assert] Asserting note id ${id}`);