Add 'bot_banner' field to ProductModel and create BotProductDetailView for bot integration
This commit is contained in:
@@ -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}'
|
||||
})
|
||||
Reference in New Issue
Block a user