list coupons
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import axios from "../../../config/axios";
|
||||
import type { CreateCouponType, CouponType } from "../types/Types";
|
||||
import type {
|
||||
CreateCouponType,
|
||||
CouponType,
|
||||
CouponsResponse,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getCoupons = async (page: number = 1) => {
|
||||
export const getCoupons = async (
|
||||
page: number = 1
|
||||
): Promise<CouponsResponse> => {
|
||||
const { data } = await axios.get(`/admin/coupon/native?page=${page}`);
|
||||
return data;
|
||||
};
|
||||
@@ -12,3 +18,7 @@ export const createCoupon = async (
|
||||
const { data } = await axios.post("/admin/coupon", couponData);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const deleteCoupon = async (couponId: string): Promise<void> => {
|
||||
await axios.delete(`/admin/coupon/${couponId}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user