feat: Add documentId filter to events.list (#2287)

This commit is contained in:
Tom Moor
2021-07-08 10:12:06 -07:00
committed by GitHub
parent 241cb11493
commit 9a1c8f07d1
2 changed files with 56 additions and 5 deletions

View File

@ -16,6 +16,7 @@ router.post("events.list", auth(), pagination(), async (ctx) => {
let {
sort = "createdAt",
actorId,
documentId,
collectionId,
direction,
name,
@ -31,10 +32,12 @@ router.post("events.list", auth(), pagination(), async (ctx) => {
if (actorId) {
ctx.assertUuid(actorId, "actorId must be a UUID");
where = {
...where,
actorId,
};
where = { ...where, actorId };
}
if (documentId) {
ctx.assertUuid(documentId, "documentId must be a UUID");
where = { ...where, documentId };
}
if (collectionId) {