Skip to content

Commit 5171797

Browse files
chore: merge conflicts
2 parents f561dad + 00ba8be commit 5171797

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@admin-bro/sequelize",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "Sequelize adapter for AdminBro",
55
"main": "index.js",
66
"scripts": {

src/resource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class Resource extends BaseResource {
179179
const parsedParams = { ...params }
180180
this.properties().forEach((property) => {
181181
const value = parsedParams[property.name()]
182-
if (['number', 'float', 'reference'].includes(property.type())) {
183-
if (value === '') {
182+
if (value === '') {
183+
if (property.isArray() || property.type() !== 'string') {
184184
delete parsedParams[property.name()]
185185
}
186186
}

src/utils/convert-filter.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ const convertFilter = (filter) => {
1919
}
2020
return {
2121
[Op.and]: [
22-
where(fn('LOWER', col(property.name())), { [Op.like]: fn('LOWER', `%${escape(value)}%`) }),
22+
...(memo[Op.and] || []),
23+
where(
24+
fn('LOWER', col(`${property.sequelizePath.Model.name}.${property.name()}`)),
25+
Op.like,
26+
fn('LOWER', `%${escape(value)}%`),
27+
),
2328
],
2429
...memo,
2530
}

0 commit comments

Comments
 (0)