mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-23 12:46:15 -06:00
Make requests with optional body work without body
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
e78e817057
commit
630ea8ec54
2 changed files with 10 additions and 6 deletions
|
|
@ -112,9 +112,11 @@ func (m *Module) AccountMutePOSTHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
form := &apimodel.UserMuteCreateUpdateRequest{}
|
||||
if err := c.ShouldBind(form); err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
if c.Request.ContentLength > 0 {
|
||||
if err := c.ShouldBind(form); err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err := normalizeCreateUpdateMute(form); err != nil {
|
||||
|
|
|
|||
|
|
@ -115,9 +115,11 @@ func (m *Module) ReportResolvePOSTHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
form := &apimodel.AdminReportResolveRequest{}
|
||||
if err := c.ShouldBind(form); err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
if c.Request.ContentLength > 0 {
|
||||
if err := c.ShouldBind(form); err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
report, errWithCode := m.processor.Admin().ReportResolve(c.Request.Context(), authed.Account, reportID, form.ActionTakenComment)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue