Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/loopctl/auth/api_key.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ defmodule Loopctl.Auth.ApiKey do
|> validate_required([:name, :role])
|> validate_inclusion(:role, @roles)
|> validate_tenant_for_role()
|> unique_constraint([:tenant_id, :agent_id],
name: :api_keys_one_role_per_agent_idx,
message: "agent already has an active key with this role"
)
end

@doc """
Expand Down
6 changes: 6 additions & 0 deletions lib/loopctl_web/controllers/story_verification_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ defmodule LoopctlWeb.StoryVerificationController do
{:error, :review_not_conducted} ->
{:error, :review_not_conducted}

{:error, :missing_capability} ->
{:error, :missing_capability}

{:error, {:invalid_transition, _ctx} = err} ->
{:error, err}

Expand All @@ -164,6 +167,9 @@ defmodule LoopctlWeb.StoryVerificationController do

{:error, :not_found} ->
{:error, :not_found}

{:error, other} ->
{:error, other}
end
end
end
Expand Down
Loading