diff options
author | 2023-11-10 17:42:48 +0100 | |
---|---|---|
committer | 2023-11-10 16:42:48 +0000 | |
commit | c7ecab9e6fb76bb10da26c803fc5838419642423 (patch) | |
tree | 41410d639bdb8b19a93e972a6d05937f82ab4299 /internal/api/model/poll.go | |
parent | [bugfix] Don't try to update suspended accounts (#2348) (diff) | |
download | gotosocial-c7ecab9e6fb76bb10da26c803fc5838419642423.tar.xz |
[chore/bugfix/horror] Allow `expires_in` and poll choices to be parsed from strings (#2346)
Diffstat (limited to 'internal/api/model/poll.go')
-rw-r--r-- | internal/api/model/poll.go | 15 |
1 files changed, 11 insertions, 4 deletions
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"` } |