Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Nov 10, 2023
1 parent c70a163 commit 1ddf245
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
13 changes: 6 additions & 7 deletions lib/orangutan/context/domain_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ defmodule Orangutan.Context.DomainContext do
Get Domain by UUID
"""
def get_domain_by_uuid(uuid) do
from(
d in Domain,
from(d in Domain,
where: d.uuid == ^uuid
)
|> Repo.one()
Expand Down Expand Up @@ -90,8 +89,8 @@ defmodule Orangutan.Context.DomainContext do
"""
def get_domains(offset, limit) do
from(d in Domain,
limit: ^limit,
offset: ^offset
where: limit == ^limit,
where: offset == ^offset
)
|> Repo.all()
end
Expand All @@ -101,9 +100,9 @@ defmodule Orangutan.Context.DomainContext do
"""
def get_user_domains(user_id, offset, limit) do
from(d in Domain,
user_id: ^user_id,
limit: ^limit,
offset: ^offset
where: user_id == ^user_id,
where: limit == ^limit,
where: offset == ^offset
)
|> Repo.all()
end
Expand Down
4 changes: 2 additions & 2 deletions lib/orangutan/context/email_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ defmodule Orangutan.Context.EmailContext do
"""
def get_emails(offset, limit) do
from(e in Email,
limit: ^limit,
offset: ^offset
where: limit == ^limit,
where: offset == ^offset
)
|> Repo.all()
end
Expand Down
10 changes: 4 additions & 6 deletions lib/orangutan/context/user_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ defmodule Orangutan.Context.UserContext do
"""
def get_users(offset, limit) do
from(u in User,
limit: ^limit,
offset: ^offset
where: limit == ^limit,
where: offset == ^offset
)
|> Repo.all()
end
Expand Down Expand Up @@ -167,8 +167,7 @@ defmodule Orangutan.Context.UserContext do
Get Meta by User ID and Key
"""
def get_meta_by_user_id_key(user_id, meta_key) do
from(
u in UserMeta,
from(u in UserMeta,
where: u.user_id == ^user_id,
where: u.key == ^meta_key
)
Expand All @@ -179,8 +178,7 @@ defmodule Orangutan.Context.UserContext do
Get User Metas
"""
def get_user_metas(user_id) do
from(
u in UserMeta,
from(u in UserMeta,
where: u.user_id == ^user_id
)
|> Repo.all()
Expand Down

0 comments on commit 1ddf245

Please sign in to comment.