refactor: improve type safety and error handling in vacation management components

- Updated the `AprovarFerias.svelte` component to use specific types for `solicitacao` and `gestorId`, enhancing type safety.
- Improved error handling by refining catch blocks to handle errors more accurately.
- Made minor adjustments to ensure consistent code formatting and readability across the component.
This commit is contained in:
2025-10-31 13:39:41 -03:00
parent 5dec7d7da7
commit 5cb63f9437
20 changed files with 155 additions and 112 deletions

View File

@@ -110,10 +110,16 @@ class AuthStore {
{}
);
if (usuarioAtualizado && this.state.usuario) {
if (usuarioAtualizado) {
// Preservar role e primeiroAcesso do estado atual
this.state.usuario = {
...this.state.usuario,
...usuarioAtualizado,
role: this.state.usuario?.role || {
_id: "",
nome: "Usuário",
nivel: 999,
},
primeiroAcesso: this.state.usuario?.primeiroAcesso ?? false,
};
localStorage.setItem(