Allow filtering by author
This commit is contained in:
@ -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' })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user