Pages Config
This commit is contained in:
@@ -25,26 +25,10 @@ export class Partner {
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const response = await http.get(`/users/partner?page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
|
||||
|
||||
const response = await http.get(`/users/partner?page=${this.page}&pageSize=${this.pageSize}`);
|
||||
this.data = response.body.data ?? []
|
||||
this.total_data = response.body.total_data ?? 0
|
||||
}
|
||||
|
||||
async getDataSubCategories() {
|
||||
const response = await http.get(`/product/sub-categories?page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
|
||||
this.dataSubCategories = response.body.data ?? []
|
||||
this.total_dataSubCategories = response.body.count ?? 0
|
||||
}
|
||||
|
||||
async getDataCategories() {
|
||||
const response = await http.get(`/product/categories?page=${this.pageCategories}&pageSize=${this.pageSizeCategories}`);
|
||||
|
||||
this.dataCategories = response.body.data ?? []
|
||||
this.total_dataCategories = response.body.total_data ?? 0
|
||||
if (this.dataCategories.length > 0) {
|
||||
this.filterCategory = this.dataCategories[0].id
|
||||
}
|
||||
//console.log(response.body,"ini dari store")
|
||||
this.total_data = response.body.count ?? 0
|
||||
}
|
||||
|
||||
async create(data) {
|
||||
@@ -54,16 +38,24 @@ export class Partner {
|
||||
}
|
||||
|
||||
async update(id, data) {
|
||||
const response = await http.put(`/product/${id}`).send(data);
|
||||
const response = await http.put(`/users/partner/${id}`).send(data);
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
|
||||
// async updateStatus(id, data) {
|
||||
// const response = await http.put(`/users/partner/${id}`).send(data);
|
||||
// await this.getData();
|
||||
// return response;
|
||||
// }
|
||||
|
||||
async delete(id) {
|
||||
const response = await http.del(`/product/${id}`);
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user