Skip to content

Commit

Permalink
Add filter for buyers in OrderItemList APIView
Browse files Browse the repository at this point in the history
  • Loading branch information
muditmahajan committed Mar 13, 2024
1 parent 1cfb3ab commit 11e1ccf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/marketplace/orders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,10 @@ def post(self, request):
| Q(order_id__order_code__icontains=filters["search"])
)

if "buyers" in filters:
orderItems = orderItems.filter(
order_id__buyer__in=filters["buyers"])

if "order_by" in filters and filters["order_by"] == "upcoming":
orderItems = orderItems.annotate(
time_difference=ExpressionWrapper(
Expand Down

0 comments on commit 11e1ccf

Please sign in to comment.