Quick update to fit current api state

This commit is contained in:
PB
2025-11-15 18:15:03 +01:00
parent fb2ba22f72
commit b9432b90d2
4 changed files with 10 additions and 116 deletions

View File

@@ -5,11 +5,10 @@ import (
"git.ego.freeddns.org/egommerce/api-entities/basket"
basket "git.ego.freeddns.org/egommerce/api-entities/basket/dto"
"github.com/go-redis/redis/v8"
)
func NewBasketAPI(ua string, redis *redis.Client) *BasketAPI {
return &BasketAPI{NewHttpClient(ua, redis)}
func NewBasketAPI() *BasketAPI {
return &BasketAPI{NewHttpClient()}
}
type BasketAPI struct {
@@ -27,9 +26,11 @@ func (a *BasketAPI) GetBasket(basketID string) (*basket.GetBasketResponseDTO, er
}
func (a *BasketAPI) GetBasketItems(basketID string) ([]*basket.GetBasketItemsResponseDTO, error) {
url := fmt.Sprintf("/api/v1/basket/%s/items", basketID)
url := fmt.Sprintf("/api/v1/basket/items")
var res []*basket.GetBasketItemsResponseDTO
if err := a.httpClient.SendGet("basket-svc", url, nil, &res); err != nil {
data := basket.GetBasketItemsRequestDTO{BasketID: basketID}
if err := a.httpClient.SendGet("basket-svc", url, data, &res); err != nil {
return nil, err
}