fix customer and quick lead
All checks were successful
Build and Publish / build-release (push) Successful in 1m8s
All checks were successful
Build and Publish / build-release (push) Successful in 1m8s
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
defmodule CustomerService.Customer.Queries do
|
defmodule CustomerService.Customer.Queries do
|
||||||
|
import Ecto.Query
|
||||||
|
|
||||||
alias CustomerService.Projections.Customer
|
alias CustomerService.Projections.Customer
|
||||||
alias CustomerService.Repo
|
alias CustomerService.Repo
|
||||||
|
|
||||||
def list_by_org(org_id, params \\ %{}) when is_binary(org_id) do
|
def list_by_org(org_id, params \\ %{}) when is_binary(org_id) do
|
||||||
params = Map.put(params, :org_id, org_id)
|
base = from(c in Customer, where: c.org_id == ^org_id)
|
||||||
Flop.validate_and_run(Customer, params, for: Customer)
|
Flop.validate_and_run(base, params, for: Customer)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_by_org(org_id, customer_id) when is_binary(org_id) and is_binary(customer_id) do
|
def get_by_org(org_id, customer_id) when is_binary(org_id) and is_binary(customer_id) do
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
defmodule CustomerService.Lead.Queries do
|
defmodule CustomerService.Lead.Queries do
|
||||||
|
import Ecto.Query
|
||||||
|
|
||||||
alias CustomerService.Projections.QuickLead
|
alias CustomerService.Projections.QuickLead
|
||||||
alias CustomerService.Repo
|
alias CustomerService.Repo
|
||||||
|
|
||||||
def list_by_org(org_id, params \\ %{}) when is_binary(org_id) do
|
def list_by_org(org_id, params \\ %{}) when is_binary(org_id) do
|
||||||
params = Map.put(params, :org_id, org_id)
|
base = from(q in QuickLead, where: q.org_id == ^org_id)
|
||||||
Flop.validate_and_run(QuickLead, params, for: QuickLead)
|
Flop.validate_and_run(base, params, for: QuickLead)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_by_org(org_id, lead_id) when is_binary(org_id) and is_binary(lead_id) do
|
def get_by_org(org_id, lead_id) when is_binary(org_id) and is_binary(lead_id) do
|
||||||
|
|||||||
Reference in New Issue
Block a user