Merge branch 'main' into feature/ui-improvements-clean

This commit is contained in:
Wesley Liddick
2025-12-28 03:22:11 -05:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/Wei-Shaw/sub2api/internal/service"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
// ApiKeyAuthGoogle is a Google-style error wrapper for API key auth.
@@ -30,7 +29,7 @@ func ApiKeyAuthWithSubscriptionGoogle(apiKeyService *service.ApiKeyService, subs
apiKey, err := apiKeyService.GetByKey(c.Request.Context(), apiKeyString)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
if errors.Is(err, service.ErrApiKeyNotFound) {
abortWithGoogleError(c, 401, "Invalid API key")
return
}

View File

@@ -152,8 +152,8 @@ export async function getStatsByDateRange(
/**
* Get usage by date range
* @param startDate - Start date (ISO format)
* @param endDate - End date (ISO format)
* @param startDate - Start date (YYYY-MM-DD format)
* @param endDate - End date (YYYY-MM-DD format)
* @param apiKeyId - Optional API key ID filter
* @returns Usage logs within date range
*/