This commit is contained in:
2025-04-09 17:10:53 +10:00
parent ecf81bcf79
commit 5cb4ab4c61
73 changed files with 229 additions and 226 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
pb "github.com/bestnite/go-igdb/proto"
"github.com/go-resty/resty/v2"
"google.golang.org/protobuf/proto"
)
@@ -13,7 +12,7 @@ type GameLocalizations struct {
BaseEndpoint[pb.GameLocalization]
}
func NewGameLocalizations(request func(URL string, dataBody any) (*resty.Response, error)) *GameLocalizations {
func NewGameLocalizations(request RequestFunc) *GameLocalizations {
a := &GameLocalizations{
BaseEndpoint[pb.GameLocalization]{
endpointName: EPGameLocalizations,
@@ -25,7 +24,7 @@ func NewGameLocalizations(request func(URL string, dataBody any) (*resty.Respons
}
func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error) {
resp, err := a.request(fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
if err != nil {
return nil, fmt.Errorf("failed to request: %w", err)
}