Apply 1 suggestion(s) to 1 file(s)

This commit is contained in:
lain 2020-08-05 11:14:58 +00:00
parent 00c4c6a382
commit 70522989d9

View File

@ -28,10 +28,10 @@ defmodule Pleroma.Web.MastodonAPI.PollView do
def render("show.json", %{object: object} = params) do def render("show.json", %{object: object} = params) do
case object.data do case object.data do
%{"anyOf" => options} when is_list(options) and options != [] -> %{"anyOf" => [ _ | _] = options} ->
render(__MODULE__, "show.json", Map.merge(params, %{multiple: true, options: options})) render(__MODULE__, "show.json", Map.merge(params, %{multiple: true, options: options}))
%{"oneOf" => options} when is_list(options) and options != [] -> %{"oneOf" => [ _ | _] = options} ->
render(__MODULE__, "show.json", Map.merge(params, %{multiple: false, options: options})) render(__MODULE__, "show.json", Map.merge(params, %{multiple: false, options: options}))
_ -> _ ->