Просмотр исходного кода

chore: billing api now will return a large number if unlimited quota is set

JustSong 2 лет назад
Родитель
Сommit
94ba3dd024
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      controller/billing.go

+ 3 - 0
controller/billing.go

@@ -32,6 +32,9 @@ func GetSubscription(c *gin.Context) {
 	if common.DisplayInCurrencyEnabled {
 	if common.DisplayInCurrencyEnabled {
 		amount /= common.QuotaPerUnit
 		amount /= common.QuotaPerUnit
 	}
 	}
+	if token.UnlimitedQuota {
+		amount = 99999999.9999
+	}
 	subscription := OpenAISubscriptionResponse{
 	subscription := OpenAISubscriptionResponse{
 		Object:             "billing_subscription",
 		Object:             "billing_subscription",
 		HasPaymentMethod:   true,
 		HasPaymentMethod:   true,