Bugs solved on method Client.activeSalesPerson()

This commit is contained in:
Juan 2018-04-03 19:37:37 +02:00
parent 749681ac73
commit ae7a8f1245
2 changed files with 11 additions and 5 deletions

View File

@ -116,7 +116,7 @@ describe('Edit basicData path', () => {
return nightmare
.getInputValue(selectors.clientBasicData.salesPersonInput)
.then(result => {
expect(result).toEqual('accessory accessory');
expect(result).toEqual('accessory');
});
});

View File

@ -27,11 +27,17 @@ module.exports = Self => {
let params = [];
if (where) {
if (where.firstName) {
sqlWhere = `AND (em.firstName REGEXP ? OR em.name REGEXP ?)`;
let search = where.firstName.regexp;
params.push(search);
params.push(search);
}
if (where.id) {
sqlWhere = `AND em.id = ?`;
params.push(where.id);
}
}
if (filter.limit) {
sqlLimit = `LIMIT ?`;
params.push(filter.limit);