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 1ddf245 commit 29652cc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
- name: Test orangutan
run: make ci

#- name: Build orangutan
# run: make build
- name: Build orangutan
run: make build
10 changes: 5 additions & 5 deletions lib/orangutan/context/domain_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ defmodule Orangutan.Context.DomainContext do
"""
def get_domains(offset, limit) do
from(d in Domain,
where: limit == ^limit,
where: offset == ^offset
where: d.limit == ^limit,
where: d.offset == ^offset
)
|> Repo.all()
end
Expand All @@ -100,9 +100,9 @@ defmodule Orangutan.Context.DomainContext do
"""
def get_user_domains(user_id, offset, limit) do
from(d in Domain,
where: user_id == ^user_id,
where: limit == ^limit,
where: offset == ^offset
where: d.user_id == ^user_id,
where: d.limit == ^limit,
where: d.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,
where: limit == ^limit,
where: offset == ^offset
where: e.limit == ^limit,
where: e.offset == ^offset
)
|> Repo.all()
end
Expand Down
4 changes: 2 additions & 2 deletions lib/orangutan/context/message_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ defmodule Orangutan.Context.MessageContext do
"""
def get_messages(offset, limit) do
from(m in Message,
limit: ^limit,
offset: ^offset
where: m.limit == ^limit,
where: m.offset == ^offset
)
|> Repo.all()
end
Expand Down
13 changes: 5 additions & 8 deletions lib/orangutan/context/user_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ defmodule Orangutan.Context.UserContext do
Get User by UUID
"""
def get_user_by_uuid(uuid) do
from(
u in User,
from(u in User,
where: u.uuid == ^uuid
)
|> Repo.one()
Expand All @@ -69,8 +68,7 @@ defmodule Orangutan.Context.UserContext do
Get User by API Key
"""
def get_user_by_api_key(api_key) do
from(
u in User,
from(u in User,
where: u.api_key == ^api_key
)
|> Repo.one()
Expand All @@ -80,8 +78,7 @@ defmodule Orangutan.Context.UserContext do
Get User by Email
"""
def get_user_by_email(email) do
from(
u in User,
from(u in User,
where: u.email == ^email
)
|> Repo.one()
Expand Down Expand Up @@ -115,8 +112,8 @@ defmodule Orangutan.Context.UserContext do
"""
def get_users(offset, limit) do
from(u in User,
where: limit == ^limit,
where: offset == ^offset
where: u.limit == ^limit,
where: u.offset == ^offset
)
|> Repo.all()
end
Expand Down

0 comments on commit 29652cc

Please sign in to comment.