feat(telecart): add vouchers and coupons (#9)

This commit is contained in:
2025-10-20 20:00:31 +03:00
parent 78ca4fd309
commit ac24f0376b
10 changed files with 149 additions and 14 deletions

View File

@@ -72,4 +72,24 @@ export async function getFiltersForMainPage() {
return await ftch('filtersForMainPage');
}
export async function setCoupon(coupon) {
const formData = new FormData();
formData.append('coupon', coupon);
return await apiFetch(`${BASE_URL}index.php?route=extension/total/coupon/coupon`, {
method: 'POST',
body: formData,
});
}
export async function setVoucher(voucher) {
const formData = new FormData();
formData.append('voucher', voucher);
return await apiFetch(`${BASE_URL}index.php?route=extension/total/voucher/voucher`, {
method: 'POST',
body: formData,
});
}
export default ftch;