fix to send votes

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-06-15 17:22:52 +02:00 committed by Andy Scherzinger (Rebase PR Action)
parent 5a070f5e1b
commit d31a9b1ade
3 changed files with 4 additions and 3 deletions

View File

@ -536,10 +536,11 @@ public interface NcApi {
Observable<PollOverall> createPoll(@Header("Authorization") String authorization,
@Url String url);
@FormUrlEncoded
@POST
Observable<PollOverall> votePoll(@Header("Authorization") String authorization,
@Url String url,
@Query("optionIds[]") List<Integer> optionIds);
@Field("optionIds[]") List<Integer> optionIds);
@DELETE
Observable<PollOverall> closePoll(@Header("Authorization") String authorization,

View File

@ -115,7 +115,7 @@ class PollResultsFragment(
val oneVoteInPercent = 100 / votersAmount
poll.options?.forEachIndexed { index, option ->
val votersForThisOption = poll.votes?.filter { it.value == index }?.size!!
val votersForThisOption = poll.votes?.filter { it.key.toInt() == index }?.size!!
val optionsPercent = oneVoteInPercent * votersForThisOption
val pollResultItem = PollResultItem(option, optionsPercent)

View File

@ -30,7 +30,7 @@
android:layout_width="wrap_content"
app:layout_constraintTop_toTopOf="parent"
tools:layout_height="400dp"
tools:layout_width="match_parent"></RadioGroup>
tools:layout_width="match_parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/submitVote"