feat(conversations): align transcript delivery
This commit is contained in:
@@ -721,6 +721,14 @@ func (h *ConversationHandler) Transcript(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if svcErr := h.conversationSvc.SendTranscript(c.Request.Context(), accountID, conversation.ID, req.Email); svcErr != nil {
|
||||
if errors.Is(svcErr, service.ErrEmailTranscriptDisabled) {
|
||||
c.JSON(http.StatusPaymentRequired, gin.H{"error": "Email transcript is not available on your plan"})
|
||||
return
|
||||
}
|
||||
if errors.Is(svcErr, service.ErrEmailRateLimited) {
|
||||
c.Status(http.StatusTooManyRequests)
|
||||
return
|
||||
}
|
||||
handleServiceError(c, svcErr)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user