diff --git a/src/component/ProductComponent.js b/src/component/ProductComponent.js index b44cd63..83ba644 100644 --- a/src/component/ProductComponent.js +++ b/src/component/ProductComponent.js @@ -129,13 +129,15 @@ export const ProductComponent = observer((props) => { }, ]; if (store.authentication.userData.role !== "Admin") columns.pop(); - if (store.authentication.userData.role === "Admin Partner") delete columns[2]; + //if (store.authentication.userData.role === "Admin Partner") delete columns[2]; if (store.authentication.userData.role === "Admin Partner") delete columns[3]; if (store.authentication.userData.role != "Admin Partner") delete columns[4]; if (store.authentication.userData.role !== "Admin") delete columns[6]; + if (store.authentication.userData.role !== "Admin") delete columns[2]; + if (store.authentication.userData.role !== "Admin") delete columns[5]; if (store.authentication.userData.role === "Admin Partner") delete columns[7]; if (store.authentication.userData.role !== "Admin") delete columns[8]; - if (store.authentication.userData.role === "Admin Partner") delete columns[5]; + //if (store.authentication.userData.role === "Admin Partner") delete columns[5]; const deleteData = async (id) => { try { @@ -288,7 +290,10 @@ export const ProductComponent = observer((props) => { bordered pagination={{ pageSize: store.product.pageSize, - total: store.product.total_data, + total: + store.authentication.userData.role === "Admin Partner" + ? store.product.total_data_partner + : store.product.total_data, current: store.product.page + 1, showSizeChanger: true, simple: false, diff --git a/src/pages/Transaction/Product.js b/src/pages/Transaction/Product.js index 742f674..cace10e 100644 --- a/src/pages/Transaction/Product.js +++ b/src/pages/Transaction/Product.js @@ -277,14 +277,14 @@ export const Product = observer(() => { required: true, message: "Please input Destination Number!", }, - { - pattern: /^(?:\d*)$/, - message: "Value should contain just number", - }, - { - pattern: /^[\d]{10,12}$/, - message: "Value should be 10 - 12 character", - }, + // { + // pattern: /^(?:\d*)$/, + // message: "Value should contain just number", + // }, + // { + // pattern: /^[\d]{1,12}$/, + // message: "Value should be 1 - 12 character", + // }, ]} > diff --git a/src/store/product.js b/src/store/product.js index ff0570f..6a0713d 100644 --- a/src/store/product.js +++ b/src/store/product.js @@ -6,6 +6,7 @@ export class Product { pageSize = 10 data = []; total_data = 0; + total_data_partner=0; filterSupplier = null; filterSubCategory = null; visibleModalProduct = false; @@ -101,6 +102,7 @@ export class Product { const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=10&sub-category=${id}`); console.log(response) this.dataProductPartner = response.body.data + this.total_data_partner= response?.body?.count ?? 0 } catch (e) { console.error(e); }