Poll View: Always return `voters_count`.

This commit is contained in:
lain 2020-11-04 10:14:00 +01:00
parent ba3f3a5a56
commit 1cfc3278c0
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ defmodule Pleroma.Web.MastodonAPI.PollView do
expired: expired,
multiple: multiple,
votes_count: votes_count,
voters_count: (multiple || nil) && voters_count(object),
voters_count: voters_count(object),
options: options,
voted: voted?(params),
emojis: Pleroma.Web.MastodonAPI.StatusView.build_emojis(object.data["emoji"])

View File

@ -44,7 +44,7 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do
],
voted: false,
votes_count: 0,
voters_count: nil
voters_count: 0
}
result = PollView.render("show.json", %{object: object})