Pleroma.Web.PleromaAPI.MascotController: fix dialyzer error due to bad error match

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:37:pattern_match
The pattern can never match the type.

Pattern:
{:content_type, _}

Type:
{:error, _}

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:40:pattern_match
The pattern can never match the type.

Pattern:
{:upload, {:error, _}}

Type:
{:error, _}
This commit is contained in:
Mark Felder 2024-01-31 11:15:48 -05:00
parent ed2f8e45e9
commit 5e8bedcca0

View File

@ -28,7 +28,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotController do
_
) do
with {:content_type, "image" <> _} <- {:content_type, file.content_type},
{:ok, object} <- ActivityPub.upload(file, actor: User.ap_id(user)) do
{_, {:ok, object}} <- {:upload, ActivityPub.upload(file, actor: User.ap_id(user))} do
attachment = render_attachment(object)
{:ok, _user} = User.mascot_update(user, attachment)