feat(inboxes): queue template sync jobs
This commit is contained in:
@@ -656,13 +656,17 @@ func (h *InboxHandler) SyncTemplates(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
templates, svcErr := h.svc.SyncTemplates(c.Request.Context(), accountID, inboxID)
|
||||
svcErr := h.svc.SyncTemplates(c.Request.Context(), accountID, inboxID)
|
||||
if svcErr != nil {
|
||||
if errors.Is(svcErr, service.ErrInboxTemplateSyncWhatsAppOnly) {
|
||||
c.JSON(http.StatusUnprocessableEntity, gin.H{"error": service.InboxTemplateSyncWhatsAppOnlyMessage})
|
||||
return
|
||||
}
|
||||
handleServiceError(c, svcErr)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"templates": templates})
|
||||
c.JSON(http.StatusOK, gin.H{"message": service.InboxTemplateSyncInitiatedMessage})
|
||||
}
|
||||
|
||||
// RegisterWebhook registers a webhook URL with the channel provider for an inbox.
|
||||
|
||||
Reference in New Issue
Block a user