From 00058c6b1a60cfc5e4e6eb5318d8dbe6335de2ee Mon Sep 17 00:00:00 2001 From: Shaheen Hyder K Date: Thu, 15 Feb 2024 04:18:47 +0530 Subject: [PATCH] change coupon verify response --- api/dashboard/coupon/coupon_view.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/dashboard/coupon/coupon_view.py b/api/dashboard/coupon/coupon_view.py index b597d2d5..764fecb4 100644 --- a/api/dashboard/coupon/coupon_view.py +++ b/api/dashboard/coupon/coupon_view.py @@ -1,12 +1,13 @@ from rest_framework.views import APIView from utils.response import CustomResponse from db.user import UserCouponLink +from rest_framework.response import Response class CouponApi(APIView): def post(self, request): if coupon_code := request.data.get('data'): if UserCouponLink.objects.filter(coupon=coupon_code).exists(): - return CustomResponse(general_message="Coupon is valid").get_success_response() - return CustomResponse(general_message="Coupon is invalid").get_failure_response() - return CustomResponse(general_message="Coupon code is required").get_failure_response() \ No newline at end of file + return Response(data={"discount_type": "Percentage", "discount_value": 100}) + return Response(data={"discount_type": "Percentage", "discount_value": 0}) + return Response(data={"discount_type": "Percentage", "discount_value": 0})