Pleroma.HTTP.RequestBuilder: fix gradient error

lib/pleroma/http/request_builder.ex: The variable key on line 69 is expected to have type String.t() but it has type atom()
This commit is contained in:
Mark Felder 2024-01-31 13:58:26 -05:00
parent cccfdde14c
commit 15621b7284

View file

@ -54,12 +54,12 @@ defmodule Pleroma.HTTP.RequestBuilder do
@doc """
Add optional parameters to the request
"""
@spec add_param(Request.t(), atom(), atom(), any()) :: Request.t()
@spec add_param(Request.t(), atom(), atom() | String.t(), any()) :: Request.t()
def add_param(request, :query, :query, values), do: %{request | query: values}
def add_param(request, :body, :body, value), do: %{request | body: value}
def add_param(request, :body, key, value) do
def add_param(request, :body, key, value) when is_binary(key) do
request
|> Map.put(:body, Multipart.new())
|> Map.update!(