From c7ecab9e6fb76bb10da26c803fc5838419642423 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:42:48 +0100 Subject: [chore/bugfix/horror] Allow `expires_in` and poll choices to be parsed from strings (#2346) --- internal/api/model/poll.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'internal/api/model/poll.go') diff --git a/internal/api/model/poll.go b/internal/api/model/poll.go index c1d2ca89e..a9842e7a9 100644 --- a/internal/api/model/poll.go +++ b/internal/api/model/poll.go @@ -80,7 +80,11 @@ type PollRequest struct { // Duration the poll should be open, in seconds. // If provided, media_ids cannot be used, and poll[options] must be provided. - ExpiresIn int `form:"expires_in" json:"expires_in" xml:"expires_in"` + ExpiresIn int `form:"expires_in" xml:"expires_in"` + + // Duration the poll should be open, in seconds. + // If provided, media_ids cannot be used, and poll[options] must be provided. + ExpiresInI interface{} `json:"expires_in"` // Allow multiple choices on this poll. Multiple bool `form:"multiple" json:"multiple" xml:"multiple"` @@ -93,7 +97,10 @@ type PollRequest struct { // // swagger:ignore type PollVoteRequest struct { - // Choices contains poll vote choice indices. Note that form - // uses a different key than the JSON, i.e. the '[]' suffix. - Choices []int `form:"choices[]" json:"choices" xml:"choices"` + // Choices contains poll vote choice indices. + Choices []int `form:"choices[]" xml:"choices"` + + // ChoicesI contains poll vote choice + // indices. Can be strings or integers. + ChoicesI []interface{} `json:"choices"` } -- cgit v1.2.3