feat(reports): align live grouped errors
This commit is contained in:
@@ -64,8 +64,8 @@ func (h *LiveReportHandler) GroupedConversationMetrics(c *gin.Context) {
|
||||
|
||||
groupBy := c.Query("group_by")
|
||||
if groupBy != "team_id" && groupBy != "assignee_id" {
|
||||
// Reference: Chatwoot returns 422 for invalid group_by
|
||||
response.AbortWithStatusError(c, http.StatusUnprocessableEntity, response.ErrBadRequest, "invalid group_by, must be team_id or assignee_id")
|
||||
// Reference: Chatwoot returns 422 with a raw { error } body for invalid group_by.
|
||||
c.AbortWithStatusJSON(http.StatusUnprocessableEntity, gin.H{"error": "invalid group_by"})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user