2021-05-03 03:44:33 -07:00
|
|
|
const express = require("express");
|
2021-05-05 06:34:23 -07:00
|
|
|
const couponController = require('../controllers/coupon') ;
|
|
|
|
|
|
|
|
const isAuth = require('../middleware/requirelogin') ;
|
|
|
|
const isAdmin = require('../middleware/isAdmin') ;
|
2021-05-03 03:21:15 -07:00
|
|
|
|
2021-05-05 06:34:23 -07:00
|
|
|
const router = express.Router();
|
2021-05-03 03:21:15 -07:00
|
|
|
|
2021-05-05 06:34:23 -07:00
|
|
|
router.get("/getAllCoupons",isAuth , isAdmin , couponController.getAllCoupons);
|
2021-05-03 03:21:15 -07:00
|
|
|
|
2021-05-05 06:34:23 -07:00
|
|
|
router.post("/addCoupon", isAuth , isAdmin ,couponController.addCoupon);
|
2021-05-03 03:44:33 -07:00
|
|
|
|
2021-05-05 06:34:23 -07:00
|
|
|
router.post("/deleteCoupon", isAuth , isAdmin ,couponController.deleteCoupon);
|
2021-05-03 03:21:15 -07:00
|
|
|
|
2021-05-03 03:44:33 -07:00
|
|
|
module.exports = router;
|