Menu Supplier
This commit is contained in:
@@ -7,7 +7,7 @@ export class Subcategory {
|
||||
data = [];
|
||||
total_data = 0;
|
||||
filterCategory = null;
|
||||
visibleModalCategory = false;
|
||||
visibleModalSubcategory = false;
|
||||
|
||||
pageCategories = 0;
|
||||
pageSizeCategories = 10
|
||||
@@ -38,24 +38,15 @@ export class Subcategory {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
async create(data) {
|
||||
const response = await http.post('/product/categories').send(data);
|
||||
const response = await http.post('/product/sub-categories').send(data);
|
||||
console.log(response)
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
|
||||
async update(id, data) {
|
||||
const response = await http.put(`/product/categories/${id}`).send(data);
|
||||
const response = await http.put(`/product/sub-categories/${id}`).send(data);
|
||||
await this.getData();
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user