Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Jul 28, 2023
1 parent f27aafb commit b710af3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/atomic/organizations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ defmodule Atomic.Organizations do
end

def get_role(user_id, organization_id) do
Membership
|> where([m], m.user_id == ^user_id and m.organization_id == ^organization_id)
|> Repo.one()
|> Map.get(:role)
membership =
Membership
|> where([m], m.user_id == ^user_id and m.organization_id == ^organization_id)
|> Repo.one()

membership[:role]
end

@doc """
Expand Down

0 comments on commit b710af3

Please sign in to comment.