feat(inboxes): enforce chatwoot inbox limits
This commit is contained in:
@@ -47,6 +47,9 @@ func (h *WebWidgetHandler) CreateWebWidgetInbox(c *gin.Context) {
|
||||
inbox, err := h.inboxSvc.CreateWebWidgetInbox(c.Request.Context(), uint(accountID), req)
|
||||
if err != nil {
|
||||
applogger.L().Errorf("Failed to create web_widget inbox: %v", err)
|
||||
if renderInboxLimitExceeded(c, err) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusUnprocessableEntity, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
@@ -157,4 +160,4 @@ func (h *WebWidgetHandler) DeleteWebWidgetInbox(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"id": inboxID, "deleted": true})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user