Add 'bot_banner' field to ProductModel and create BotProductDetailView for bot integration

This commit is contained in:
Parsa Nazer
2025-08-05 00:13:47 +03:30
parent d9b6655ee8
commit e9b1666423
5 changed files with 34 additions and 5 deletions
+11 -1
View File
@@ -459,4 +459,14 @@ class BotProductsView(APIView):
return Response({
"success": False,
"products": []
})
})
class BotProductDetailView(APIView):
def get(self, request, pk):
product = get_object_or_404(ProductModel, pk=pk, show_in_bot=True)
return Response({
'banner' : product.banner,
'link': f'https://heymlz.com/product/{product.slug}'
})