feat(conversations): align toggle priority fallback

This commit is contained in:
2026-06-07 11:04:40 +08:00
parent e6c9660659
commit 148201905a
3 changed files with 38 additions and 7 deletions
@@ -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 {