chore: stabilize chatwoot parity baseline
This commit is contained in:
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user