fix: Archived documents should not be returned from documents.list

closes #1575
This commit is contained in:
Tom Moor
2020-10-13 20:38:28 -07:00
parent 428171a1ec
commit 4044818daa
2 changed files with 20 additions and 1 deletions

View File

@ -46,7 +46,12 @@ router.post("documents.list", auth(), pagination(), async (ctx) => {
// always filter by the current team
const user = ctx.state.user;
let where = { teamId: user.teamId };
let where = {
teamId: user.teamId,
archivedAt: {
[Op.eq]: null,
},
};
if (template) {
where = { ...where, template: true };