Advanced filter by ref
gitea/salix/2150-travel_filter_by_ref This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-02-27 09:03:36 +01:00
parent 21ace6ef4e
commit 70210e87c9
1 changed files with 5 additions and 1 deletions

View File

@ -63,6 +63,10 @@ module.exports = Self => {
type: 'Number', type: 'Number',
description: 'The totalEntries filter', description: 'The totalEntries filter',
http: {source: 'query'} http: {source: 'query'}
}, {
arg: 'ref',
type: 'string',
description: 'The reference'
} }
], ],
returns: { returns: {
@ -82,7 +86,7 @@ module.exports = Self => {
case 'search': case 'search':
return {'t.id': value}; return {'t.id': value};
case 'ref': case 'ref':
return {[param]: {regexp: value}}; return {'t.ref': {like: `%${value}%`}};
case 'shippedFrom': case 'shippedFrom':
return {'t.shipped': {gte: value}}; return {'t.shipped': {gte: value}};
case 'shippedTo': case 'shippedTo':