fix: use optional chaining for departmentFk in useRole composable
gitea/salix-front/pipeline/pr-test This commit is unstable Details

This commit is contained in:
Javier Segarra 2025-04-03 20:07:54 +02:00
parent 2992ac2d0d
commit 21c3384509
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ export function useRole() {
name: data.user.name,
nickname: data.user.nickname,
lang: data.user.lang || 'es',
departmentFk: data.user.worker.department.departmentFk,
departmentFk: data.user?.worker?.department?.departmentFk,
};
state.setUser(userData);
state.setRoles(roles);