feat: fixing filter admin partner
This commit is contained in:
@@ -101,14 +101,27 @@ export class Product {
|
||||
}
|
||||
|
||||
async getProductPartner(id) {
|
||||
try {
|
||||
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=${this.pageSizeProductPartner}&sub-category=${id}`);
|
||||
console.log(response)
|
||||
this.dataProductPartner = response.body.data
|
||||
this.total_data_partner = response?.body?.count ?? 0
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
if (id === undefined) {
|
||||
try {
|
||||
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=${this.pageSizeProductPartner}&sub-category=`);
|
||||
console.log(response)
|
||||
this.dataProductPartner = response.body.data
|
||||
this.total_data_partner = response?.body?.count ?? 0
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=${this.pageSizeProductPartner}&sub-category=${id}`);
|
||||
console.log(response)
|
||||
this.dataProductPartner = response.body.data
|
||||
this.total_data_partner = response?.body?.count ?? 0
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async create(data) {
|
||||
|
||||
Reference in New Issue
Block a user