Fix order of args for vote/3

This commit is contained in:
Mark Felder 2024-07-22 18:38:02 -04:00
commit 1cccc0fc21
7 changed files with 14 additions and 14 deletions

View file

@ -329,8 +329,8 @@ defmodule Pleroma.Web.CommonAPI do
end
end
@spec vote(User.t(), Object.t(), list()) :: {:ok, list(), Object.t()} | {:error, any()}
def vote(user, %{data: %{"type" => "Question"}} = object, choices) do
@spec vote(Object.t(), User.t(), list()) :: {:ok, list(), Object.t()} | {:error, any()}
def vote(%Object{data: %{"type" => "Question"}} = object, %User{} = user, choices) do
with :ok <- validate_not_author(object, user),
:ok <- validate_existing_votes(user, object),
{:ok, options, choices} <- normalize_and_validate_choices(choices, object) do