feat(conversations): align toggle status fallback
This commit is contained in:
@@ -2,6 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -297,9 +298,11 @@ func (h *ConversationHandler) ToggleStatus(c *gin.Context) {
|
||||
}
|
||||
|
||||
var req service.ToggleStatusRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrValidation, err.Error())
|
||||
return
|
||||
if c.Request.Body != nil && c.Request.Body != http.NoBody {
|
||||
if err := c.ShouldBindJSON(&req); err != nil && !errors.Is(err, io.EOF) {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrValidation, err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
conversation, ok := h.resolveConversationRoute(c, accountID, conversationID)
|
||||
|
||||
Reference in New Issue
Block a user