commit 5f51520c3f00c52cdba047cfd403839216d19003
parent baa1ee4ef0dc0ee6ee324478951604d8370cf550
Author: srfsh <dev@srf.sh>
Date: Wed, 4 Jan 2023 20:42:56 +0300
Zenflows.VF.Proposal.Query: distinct on id
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/zenflows/vf/proposal/query.ex b/src/zenflows/vf/proposal/query.ex
@@ -28,7 +28,7 @@ alias Zenflows.VF.Proposal
def all(%{filter: nil}), do: {:ok, Proposal}
def all(%{filter: params}) do
with {:ok, filters} <- all_validate(params) do
- {:ok, Enum.reduce(filters, Proposal, &all_f(&2, &1))}
+ {:ok, Enum.reduce(filters, Proposal, &all_f(&2, &1)) |> distinct([x], x.id)}
end
end