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})