diff options
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r-- | server/models/utils.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts index 7137419a2..bdf2291f0 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -208,13 +208,15 @@ function buildDirectionAndField (value: string) { | |||
208 | } | 208 | } |
209 | 209 | ||
210 | function searchAttribute (sourceField, targetField) { | 210 | function searchAttribute (sourceField, targetField) { |
211 | return sourceField | 211 | if (sourceField) { |
212 | ? { | 212 | return { |
213 | [targetField]: { | 213 | [targetField]: { |
214 | [Op.iLike]: `%${sourceField}%` | 214 | [Op.iLike]: `%${sourceField}%` |
215 | } | 215 | } |
216 | } | 216 | } |
217 | : {} | 217 | } else { |
218 | return {} | ||
219 | } | ||
218 | } | 220 | } |
219 | 221 | ||
220 | // --------------------------------------------------------------------------- | 222 | // --------------------------------------------------------------------------- |