Skip to content

Commit

Permalink
Remove old Plausible.Auth.Invitation references (#4920)
Browse files Browse the repository at this point in the history
* remove Plausible.Auth.Invitation refs

* format

* reword
  • Loading branch information
ruslandoga authored Dec 18, 2024
1 parent 98b64b4 commit b72ab44
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/plausible/site/memberships/create_invitation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Plausible.Site.Memberships.CreateInvitation do
transfers.
"""

alias Plausible.Auth.{User, Invitation}
alias Plausible.Auth.User
alias Plausible.Site
alias Plausible.Repo
alias Plausible.Teams
Expand All @@ -18,12 +18,14 @@ defmodule Plausible.Site.Memberships.CreateInvitation do
| {:over_limit, non_neg_integer()}
| :forbidden

@type invitation :: %Teams.GuestInvitation{} | %Teams.SiteTransfer{}

@spec create_invitation(Site.t(), User.t(), String.t(), atom()) ::
{:ok, Invitation.t()} | {:error, invite_error()}
{:ok, invitation} | {:error, invite_error()}
@doc """
Invites a new team member to the given site. Returns a
%Plausible.Auth.Invitation{} struct and sends the invitee an email to accept
this invitation.
Invites a new team member to the given site. Returns either
`%Teams.GuestInvitation{}` or `%Teams.SiteTransfer{}` struct
and sends the invitee an email to accept this invitation.
The inviter must have enough permissions to invite the new team member,
otherwise this function returns `{:error, :forbidden}`.
Expand All @@ -38,7 +40,7 @@ defmodule Plausible.Site.Memberships.CreateInvitation do
end

@spec bulk_create_invitation([Site.t()], User.t(), String.t(), atom(), Keyword.t()) ::
{:ok, [Invitation.t()]} | {:error, invite_error()}
{:ok, [invitation]} | {:error, invite_error()}
def bulk_create_invitation(sites, inviter, invitee_email, role, opts \\ []) do
Repo.transaction(fn ->
for site <- sites do
Expand Down

0 comments on commit b72ab44

Please sign in to comment.