feat: update supplier status

This commit is contained in:
2021-12-15 15:35:57 +07:00
parent 5e3f8fa3a2
commit c8278c2cea
5 changed files with 25 additions and 2 deletions

View File

@@ -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() {

View File

@@ -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;
}
}