feat: update supplier status
This commit is contained in:
@@ -27,8 +27,14 @@ export class Product {
|
||||
async getData() {
|
||||
const response = await http.get(`/product/by-categories?categories=${this.filterCategory}&page=${this.page}&pageSize=${this.pageSize}`);
|
||||
|
||||
this.data = response.body.data ?? []
|
||||
this.data = response.body.data.map((item, idx) => {
|
||||
item.key = idx;
|
||||
return item
|
||||
}) ?? []
|
||||
|
||||
this.total_data = response.body.total_data ?? 0
|
||||
|
||||
console.log(response.body.data, this.filterCategory);
|
||||
}
|
||||
|
||||
async getDataSubCategories() {
|
||||
|
||||
@@ -48,6 +48,12 @@ export class Supplier {
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
|
||||
async changeStatus(id, status) {
|
||||
const response = await http.get(`/users/supplier/${id}/${status}`);
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user