This commit is contained in:
2021-12-17 14:22:20 +07:00
4 changed files with 63 additions and 46 deletions

View File

@@ -44,10 +44,11 @@ export const Membership = observer(() => {
const init = async () => {
try {
setIsLoading(true);
const isAdmin = store.authentication.userData.role === "Admin";
await getData();
store.role.getData();
if (store.authentication.userData.role === "Admin")
await store.supplier.getData();
await store.role.getData(isAdmin);
if (isAdmin) await store.supplier.getData();
setIsLoading(false);
} catch (e) {
setIsLoading(false);