}
function searchAttribute (sourceField, targetField) {
- return sourceField
- ? {
+ if (sourceField) {
+ return {
[targetField]: {
[Op.iLike]: `%${sourceField}%`
}
}
- : {}
+ } else {
+ return {}
+ }
}
// ---------------------------------------------------------------------------