diff --git a/src/pages/App/DesktopLayout.js b/src/pages/App/DesktopLayout.js index 4316984..6172ca9 100644 --- a/src/pages/App/DesktopLayout.js +++ b/src/pages/App/DesktopLayout.js @@ -124,7 +124,7 @@ export const DesktopLayout = observer(() => { {store.authentication.userData.role !== "Retail" && ( - + Membership @@ -168,18 +168,22 @@ export const DesktopLayout = observer(() => { Product - - - - Category - - - - - - Sub Category - - + {store.authentication.userData.role === "Admin" && ( + + + + Category + + + )} + {store.authentication.userData.role === "Admin" && ( + + + + Sub Category + + + )} )} {store.authentication.userData.role !== "Admin" && ( @@ -204,12 +208,14 @@ export const DesktopLayout = observer(() => { Payback - - - - Profile - - + {store.authentication.userData.role !== "Admin" && ( + + + + Profile + + + )} diff --git a/src/pages/App/MenuList.js b/src/pages/App/MenuList.js index f7796cd..9253e0c 100644 --- a/src/pages/App/MenuList.js +++ b/src/pages/App/MenuList.js @@ -90,18 +90,22 @@ export const MenuList = observer((props) => { Product - - - - Category - - - - - - Sub Category - - + {store.authentication.userData.role === "Admin" && ( + + + + Category + + + )} + {store.authentication.userData.role === "Admin" && ( + + + + Sub Category + + + )} )} {store.authentication.userData.role !== "Admin" && ( @@ -126,12 +130,14 @@ export const MenuList = observer((props) => { Payback - - - - Profile - - + {store.authentication.userData.role !== "Admin" && ( + + + + Profile + + + )} {/**/} {/* */} {/* */} diff --git a/src/pages/Membership/Membership.js b/src/pages/Membership/Membership.js index 34b29eb..25fe9cb 100644 --- a/src/pages/Membership/Membership.js +++ b/src/pages/Membership/Membership.js @@ -39,7 +39,6 @@ export const Membership = observer(() => { const [confirmLoading, setConfirmLoading] = useState(false); const [isLoading, setIsLoading] = useState(false); - useEffect(() => { const init = async () => { try { @@ -89,11 +88,11 @@ export const Membership = observer(() => { setConfirmLoading(true); try { data.destination = destination; - if(data.amount) { + if (data.amount) { data = { ...data, - amount: Number(data.amount) - } + amount: Number(data.amount), + }; } (await store.authentication.userData.role) === "Admin" @@ -155,7 +154,7 @@ export const Membership = observer(() => { diff --git a/src/store/membership.js b/src/store/membership.js index b68f75b..574f504 100644 --- a/src/store/membership.js +++ b/src/store/membership.js @@ -15,7 +15,7 @@ export class Membership { async getData() { try { const response = await http.get(`/users?page=${this.page}&pageSize=${this.pageSize}`); - + console.log(response,"admin") this.data = response.body.data.map((item, idx) => { item.key = idx; item.name = item?.user_detail?.name; @@ -33,6 +33,7 @@ export class Membership { async getDataBySuperior() { try { const response = await http.get(`/users/find-by-supperior?page=${this.page}&pageSize=${this.pageSize}`); + console.log(response,"non admin") this.data = response.body.data.map((item, idx) => { item.key = idx; item.name = item?.user_detail?.name; diff --git a/tes.http b/tes.http new file mode 100644 index 0000000..5c8644d --- /dev/null +++ b/tes.http @@ -0,0 +1,17 @@ +POST https://ppob-backend.k3s.bangun-kreatif.com/v1/auth/login HTTP/1.1 +content-type: application/json + +{ + "username": "admin", + "password": 123 +} + +### + +POST https://ppob-backend.k3s.bangun-kreatif.com/v1/auth/login HTTP/1.1 +content-type: application/json + +{ + "username": "admin", + "password": 123 +} \ No newline at end of file