7129-fixFilter #2766

Merged
pablone merged 6 commits from 7129-fixFilter into test 2024-07-22 15:52:23 +00:00
2 changed files with 11 additions and 12 deletions
Showing only changes of commit b73eceb1c8 - Show all commits

View File

@ -96,16 +96,15 @@ module.exports = Self => {
return {'created': {gte: value}};
case 'to':
return {'created': {lte: value}};
case 'm3':
return {'m3': value};
case 'description':
return {'description': {like: `%${value}%`}};
case 'isOk':
case 'm3':
case 'warehouseFk':
return {[param]: value};
case 'workerFk':
case 'vehicleFk':
case 'agencyModeFk':
return {[param]: value};
case 'isOk':
return {'isOk': value};
}
});

View File

@ -28,11 +28,11 @@ module.exports = Self => {
if (canViewAll) {
const userConfig = await models.UserConfig.getUserConfig(ctx, myOptions);
pablone marked this conversation as resolved
Review

Estas usando solo una propiedad del userConfig, a lo mejor desestructurarlo

Estas usando solo una propiedad del userConfig, a lo mejor desestructurarlo
filterGrant = {
where: {'a.warehouseFk': userConfig.warehouseFk}
where: {'warehouseFk': userConfig.warehouseFk}
};
} else {
filterGrant = {
where: {'r.workerFk': userId}
where: {'workerFk': userId}
};
}
@ -46,16 +46,16 @@ module.exports = Self => {
and: [
{
or: [
{'r.created': currentDate},
{'r.created': nextDay}
{'created': currentDate},
{'created': nextDay}
]
}
]
},
order: [
'r.created ASC',
'r.time ASC',
'am.name ASC'
'created ASC',
'time ASC',
'agencyName ASC'
]
};