diff options
author | lain <lain@soykaf.club> | 2020-11-04 10:14:00 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-11-04 10:14:00 +0100 |
commit | 1cfc3278c086c9eaa7b2d1bd170e82c8b2aebd78 (patch) | |
tree | dfd26f5f74ca9a219b95f077053fa639435287a2 | |
parent | ba3f3a5a56d4a5ac05443fd30b5864778ad1131e (diff) | |
download | pleroma-1cfc3278c086c9eaa7b2d1bd170e82c8b2aebd78.tar.gz |
Poll View: Always return `voters_count`.
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/poll_view.ex | 2 | ||||
-rw-r--r-- | test/pleroma/web/mastodon_api/views/poll_view_test.exs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/poll_view.ex b/lib/pleroma/web/mastodon_api/views/poll_view.ex index 1208dc9a0..4101f21d0 100644 --- a/lib/pleroma/web/mastodon_api/views/poll_view.ex +++ b/lib/pleroma/web/mastodon_api/views/poll_view.ex @@ -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"]) diff --git a/test/pleroma/web/mastodon_api/views/poll_view_test.exs b/test/pleroma/web/mastodon_api/views/poll_view_test.exs index b7e2f17ef..c655ca438 100644 --- a/test/pleroma/web/mastodon_api/views/poll_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/poll_view_test.exs @@ -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}) |