feat(conversations): align toggle priority fallback
This commit is contained in:
@@ -576,9 +576,11 @@ func (h *ConversationHandler) TogglePriority(c *gin.Context) {
|
||||
var req struct {
|
||||
Priority *string `json:"priority"`
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
priority := ""
|
||||
if req.Priority != nil {
|
||||
|
||||
Reference in New Issue
Block a user