mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Allow filtering by author
This commit is contained in:
parent
f9fa4656d0
commit
83dbb54896
2 changed files with 10 additions and 0 deletions
|
|
@ -280,6 +280,7 @@ export const parseSearchQuery = (query: string | undefined): SearchFilter => {
|
|||
'sort',
|
||||
'has',
|
||||
'saved',
|
||||
'author',
|
||||
'published',
|
||||
'subscription',
|
||||
'language',
|
||||
|
|
@ -355,6 +356,7 @@ export const parseSearchQuery = (query: string | undefined): SearchFilter => {
|
|||
break
|
||||
}
|
||||
// match filters
|
||||
case 'author':
|
||||
case 'title':
|
||||
case 'description':
|
||||
case 'content': {
|
||||
|
|
|
|||
|
|
@ -151,3 +151,11 @@ describe('query with in param set to invalid value', () => {
|
|||
expect(result.inFilter).to.eq(InFilter.INBOX)
|
||||
})
|
||||
})
|
||||
|
||||
describe('query with author set', () => {
|
||||
it('adds author to the match filters', () => {
|
||||
const result = parseSearchQuery('author:"Omnivore Blog"')
|
||||
expect(result.matchFilters).to.contain({ field: 'author', value:'omnivore blog' })
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue