chore: stabilize chatwoot parity baseline

This commit is contained in:
2026-06-04 18:12:50 +08:00
parent 8ac150bc7b
commit 42cdab880c
39 changed files with 1028 additions and 696 deletions
@@ -154,6 +154,10 @@ func (h *DraftMessageHandler) Search(c *gin.Context) {
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "search query 'q' is required")
return
}
if !h.draftSvc.Ready() {
response.AbortWithStatusError(c, http.StatusUnprocessableEntity, response.ErrInternal, "failed to search draft messages")
return
}
drafts, svcErr := h.draftSvc.Search(c.Request.Context(), accountID, query)
if svcErr != nil {
@@ -172,6 +176,10 @@ func (h *DraftMessageHandler) Count(c *gin.Context) {
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid account_id")
return
}
if !h.draftSvc.Ready() {
response.AbortWithStatusError(c, http.StatusUnprocessableEntity, response.ErrInternal, "failed to count draft messages")
return
}
count, svcErr := h.draftSvc.Count(c.Request.Context(), accountID)
if svcErr != nil {
@@ -180,4 +188,4 @@ func (h *DraftMessageHandler) Count(c *gin.Context) {
}
response.OK(c, gin.H{"count": count})
}
}