Open shamspias opened 1 year ago
That is not the correct api to fetch a users basket. You should use /api/basket/
That is not the correct API to fetch a user's basket. You should use
/api/basket/
Thanks to let me know. but why this API: /api/baskets/ then ? at least if it's useless then it should be removed right? at let's need remove the lines
oscarapi/views/basic.py
else: # anonymous users have max 1 basket.
basket = get_anonymous_basket(self.request)
mapped_with_baskets = [prepare_basket(basket, self.request)]
In our context we have sessions disabled, so we can't have an anonymous basket in the session, which leads to this AttributeError
too.
A way to fix it could be, in class BasketList(generics.ListAPIView):
to check the result of get_anonymous_basket
against Null
and just return an empty list if it's the case.
While I'm at it, I'm opening #339.
when trying to fetch baskets API to get anonymous cart information it shows
API:
/api/baskets/
request: GET view: BasketListproblem point: oscarapi/views/basic.py 78 number line.
if no cart/basket is in session it shows an error but needs an error handler.