-
Notifications
You must be signed in to change notification settings - Fork 22
Open
@TrilipuT
Description
Hey there!
I have one issue that i have solved but seems like I didn't get to the cause of it.
So when I'm using isArray for field and substringSearch: true it sets additional " into value
See 063 in the query.
🪲📜 PG Q: SELECT "id", "plate", "name", "phones", "status", "type", "building", "flat", "created_at", "updated_at", "expire_at", "comments", "is_us_plate" FROM "vehicle" WHERE "phones" ILIKE 1ドル AND "status" IS DISTINCT FROM 2ドル AND "building" = 3ドル ORDER BY "id" DESC LIMIT 4ドル OFFSET 5ドル params: [ '%"063"%', 2, 'b4', 50, 0 ]
🪲📜 PG Q: SELECT COUNT(*) FROM "vehicle" WHERE "phones" ILIKE 1ドル AND "status" IS DISTINCT FROM 2ドル AND "building" = 3ドル values: [ '%"\\"063\\""%', 2, 'b4' ]
so seems like those quotes are ambigious for like query.
I found only one way is to replace it. In file postgres data connector. But i think that might have a better way to solve it.
if (filter.operator == AdminForthFilterOperators.LIKE || filter.operator == AdminForthFilterOperators.ILIKE) { let value = filter.value.replaceAll('"',''); value = value.replaceAll('\\',''); return [`%${value}%`]; }
Here's my column setup
{
name: 'phones',
type: AdminForthDataTypes.JSON,
isArray: {
enabled: true,
itemType: AdminForthDataTypes.STRING,
},
minLength: 12,
filterOptions: {
debounceTimeMs: 800,
substringSearch: true,
},
}
Please let me know if that can be fixed somehow...
Thanks!
Metadata
Metadata
Assignees
Labels
No labels