fix permission edit registry

This commit is contained in:
Warunee Tamkoo 2025-06-05 11:57:30 +07:00
parent 01e1da066f
commit 4812e671ff
2 changed files with 8 additions and 7 deletions

View file

@ -181,11 +181,11 @@ export default {
//EditPage
salaryTemp: `${orgProfile}/salaryTemp`,
profilePermission: `${orgProfile}/keycloak/permissionProfile`,
profilePermission: (rootId: string) =>
`${orgProfile}/keycloak/permissionProfile/${rootId}`,
profileidPosition: (type: string) =>
`${orgProfile}${type}/profileid/position`,
workflowCommanderOperate:`${workflow}/commander/operate`,
workflowCommanderSign:`${workflow}/commander/sign`,
workflowCommanderOperate: `${workflow}/commander/operate`,
workflowCommanderSign: `${workflow}/commander/sign`,
};

View file

@ -47,6 +47,7 @@ async function fetchDataProfile() {
.then(async (res) => {
const data = res.data.result;
statusCheckEdit.value = data.statusCheckEdit;
fetchPromission(data.rootId);
dataProfile.value = {
fullName: `${data.prefix}${data.firstName} ${data.lastName}`,
position: data.position,
@ -62,9 +63,9 @@ async function fetchDataProfile() {
});
}
function fetchPromission() {
function fetchPromission(rootId: string) {
http
.get(config.API.profilePermission)
.get(config.API.profilePermission(rootId))
.then((res) => {
const data = res.data.result;
isConfirmEdit.value = data.isEdit;
@ -133,7 +134,7 @@ function onConfirmDone() {
onMounted(async () => {
try {
showLoader();
await Promise.all([fetchDataProfile(), fetchPromission()]);
await fetchDataProfile();
} catch (err) {
messageError($q, err);
} finally {