feat: add missing endpoitn implementation

This commit is contained in:
2025-09-27 01:04:07 +02:00
parent bdc2c88f83
commit 28a6cd4ec6
70 changed files with 24815 additions and 117 deletions

28
client/stages.go Normal file
View File

@@ -0,0 +1,28 @@
package client
import (
"context"
"net/http"
"github.com/kratisto/tcgdex-golang/models"
)
// Stages retrieves all Pokemon stages.
func (s *tcgDexClient) Stages(ctx context.Context) ([]string, error) {
request, err := http.NewRequestWithContext(ctx, http.MethodGet, s.baseURL+"/stages", nil)
if err != nil {
return nil, err
}
return doRequestSlice[string](s.httpClient, request)
}
// GetCardsByStage retrieves all cards for a given stage.
func (s *tcgDexClient) GetCardsByStage(ctx context.Context, stage string) ([]models.Card, error) {
request, err := http.NewRequestWithContext(ctx, http.MethodGet, s.baseURL+"/stages/"+stage, nil)
if err != nil {
return nil, err
}
return doRequestSlice[models.Card](s.httpClient, request)
}