summaryrefslogtreecommitdiff
path: root/internal/api/client/statuses/statuscreate.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-08 14:32:17 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-08 14:32:17 +0000
commite9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch)
tree52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/api/client/statuses/statuscreate.go
parent[chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff)
downloadgotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/api/client/statuses/statuscreate.go')
-rw-r--r--internal/api/client/statuses/statuscreate.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go
index e8378f461..5034e53b1 100644
--- a/internal/api/client/statuses/statuscreate.go
+++ b/internal/api/client/statuses/statuscreate.go
@@ -103,7 +103,12 @@ func (m *Module) StatusCreatePOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.Status().Create(c.Request.Context(), authed.Account, authed.Application, form)
+ apiStatus, errWithCode := m.processor.Status().Create(
+ c.Request.Context(),
+ authed.Account,
+ authed.Application,
+ form,
+ )
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
@@ -144,7 +149,7 @@ func validateNormalizeCreateStatus(form *apimodel.AdvancedStatusCreateForm) erro
}
if form.Poll != nil {
- if form.Poll.Options == nil {
+ if len(form.Poll.Options) == 0 {
return errors.New("poll with no options")
}
if len(form.Poll.Options) > maxPollOptions {