Fix roles in users module navigation not updating (#11501)

This commit is contained in:
Azri Kahar
2022-02-16 22:30:48 +08:00
committed by GitHub
parent 4e1c22bd88
commit 3211302a9c

View File

@@ -14,7 +14,7 @@ export default function useNavigation(): { roles: Ref<Role[] | null>; loading: R
loading = ref(false);
}
if (roles.value === null && loading?.value === false) {
if (loading?.value === false) {
fetchRoles();
}
@@ -22,7 +22,7 @@ export default function useNavigation(): { roles: Ref<Role[] | null>; loading: R
async function fetchRoles() {
if (!loading || !roles) return;
loading.value = true;
if (!roles.value) loading.value = true;
const rolesResponse = await api.get(`/roles`, {
params: {