create coupon section
This commit is contained in:
@@ -18,6 +18,12 @@ export const useDiscountStore = defineStore('discounts', {
|
||||
return this.items = data
|
||||
|
||||
},
|
||||
async add(form) {
|
||||
this.fetching = true
|
||||
const { status, data } = await axios.post('/admins/discount', form)
|
||||
this.fetching = false
|
||||
return data
|
||||
},
|
||||
async getDiscount(id) {
|
||||
this.items = [];
|
||||
this.fetching = true
|
||||
@@ -26,6 +32,16 @@ export const useDiscountStore = defineStore('discounts', {
|
||||
return this.items = data
|
||||
|
||||
},
|
||||
async update(form) {
|
||||
const { status, data } = await axios.put('/admins/discount', form)
|
||||
this.fetching = false
|
||||
return data
|
||||
},
|
||||
async changeStatus(form) {
|
||||
const { status, data } = await axios.patch('/admins/discount/status', form)
|
||||
this.fetching = false
|
||||
return data
|
||||
}
|
||||
// async create(newCourse) {
|
||||
// const { status, data } = await axios.post('/course', newCourse)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user