Search archived documents (#932)

* POC

* Improved styling

* Test
This commit is contained in:
Tom Moor
2019-04-09 09:20:30 -07:00
committed by GitHub
parent 57e051d62b
commit c1256c61aa
6 changed files with 89 additions and 34 deletions

View File

@@ -224,7 +224,7 @@ Document.searchForUser = async (
FROM documents
WHERE "searchVector" @@ to_tsquery('english', :query) AND
"collectionId" IN(:collectionIds) AND
"archivedAt" IS NULL AND
${options.includeArchived ? '' : '"archivedAt" IS NULL AND'}
"deletedAt" IS NULL AND
("publishedAt" IS NOT NULL OR "createdById" = '${user.id}')
ORDER BY