u
This commit is contained in:
		| @@ -5,7 +5,6 @@ import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	pb "github.com/bestnite/go-igdb/proto" | ||||
| 	"github.com/go-resty/resty/v2" | ||||
|  | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
| @@ -14,7 +13,7 @@ type Companies struct { | ||||
| 	BaseEndpoint[pb.Company] | ||||
| } | ||||
|  | ||||
| func NewCompanies(request func(URL string, dataBody any) (*resty.Response, error)) *Companies { | ||||
| func NewCompanies(request RequestFunc) *Companies { | ||||
| 	a := &Companies{ | ||||
| 		BaseEndpoint[pb.Company]{ | ||||
| 			endpointName: EPCompanies, | ||||
| @@ -26,7 +25,7 @@ func NewCompanies(request func(URL string, dataBody any) (*resty.Response, error | ||||
| } | ||||
|  | ||||
| func (a *Companies) Query(query string) ([]*pb.Company, 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) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user