From 21c3384509f59ef04200cbd50c549455d823b480 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 3 Apr 2025 20:07:54 +0200 Subject: [PATCH] fix: use optional chaining for departmentFk in useRole composable --- src/composables/useRole.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composables/useRole.js b/src/composables/useRole.js index e700b1f2e..e4e4f52c7 100644 --- a/src/composables/useRole.js +++ b/src/composables/useRole.js @@ -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);