commit 6ddaa993b2056ad4cb4c88e795026f4504714e93
parent 3c2614a0db4264d2a992cbb76cb8571fac78e66b
Author: srfsh <dev@srf.sh>
Date: Tue, 15 Nov 2022 11:23:52 +0300
Zenflows.VF.EconomicResource.Query: make name filter fuzzy
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/zenflows/vf/economic_resource/query.ex b/src/zenflows/vf/economic_resource/query.ex
@@ -54,9 +54,9 @@ defp all_f(q, {:gt_onhand_quantity_has_numerical_value, v}),
defp all_f(q, {:or_gt_onhand_quantity_has_numerical_value, v}),
do: or_where(q, [x], x.onhand_quantity_has_numerical_value > ^v)
defp all_f(q, {:name, v}),
- do: where(q, [x], ilike(x.name, ^v))
+ do: where(q, [x], ilike(x.name, ^"%#{v}%"))
defp all_f(q, {:namen, v}),
- do: or_where(q, [x], ilike(x.name, ^v))
+ do: or_where(q, [x], ilike(x.name, ^"%#{v}%"))
@spec all_validate(Schema.params()) ::
{:ok, Changeset.data()} | {:error, Changeset.t()}