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:
@@ -87,7 +87,7 @@ function calcularDataFimPeriodo(dataAdmissao: string, anosPassados: number): str
|
||||
}
|
||||
|
||||
// Helper: Obter regime de trabalho do funcionário
|
||||
async function obterRegimeTrabalho(ctx: any, funcionarioId: Id<"funcionarios">): Promise<RegimeTrabalho> {
|
||||
async function obterRegimeTrabalho(ctx: QueryCtx, funcionarioId: Id<"funcionarios">): Promise<RegimeTrabalho> {
|
||||
const funcionario = await ctx.db.get(funcionarioId);
|
||||
return funcionario?.regimeTrabalho || "clt"; // Default CLT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user