isOfficer

This commit is contained in:
setthawutttty 2024-10-25 17:43:51 +07:00
parent 6da1827526
commit e043a3c9cc
4 changed files with 74 additions and 37 deletions

View file

@ -32,6 +32,9 @@ const {
success,
} = mixin;
const isOfficer = ref<boolean | null>(null);
const isStaff = ref<boolean | null>(null);
const paramsId = route.params.id;
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
@ -140,11 +143,27 @@ const getClass = (val: boolean) => {
};
};
async function getWorkFlow() {
showLoader();
await http
.get(config.API.workflowKeycloakSystem("ORG_COMMAND"))
.then(async (res) => {
const data = await res.data.result;
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
roleAdmin.value = data.isOfficer;
hideLoader();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
getWorkFlow();
fetchData();
});
</script>