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:
@@ -20,11 +20,12 @@ async function getUsuarioAutenticado(ctx: QueryCtx | MutationCtx) {
|
||||
.first();
|
||||
}
|
||||
|
||||
// Se não encontrou via Better Auth, tentar via sessão
|
||||
// Se não encontrou via Better Auth, tentar via sessão mais recente
|
||||
if (!usuarioAtual) {
|
||||
const sessaoAtiva = await ctx.db
|
||||
.query("sessoes")
|
||||
.filter((q) => q.eq(q.field("ativo"), true))
|
||||
.order("desc")
|
||||
.first();
|
||||
|
||||
if (sessaoAtiva) {
|
||||
@@ -875,7 +876,7 @@ export const buscarMensagens = query({
|
||||
c.participantes.includes(usuarioAtual._id)
|
||||
);
|
||||
|
||||
let mensagens: any[] = [];
|
||||
let mensagens: Doc<"mensagens">[] = [];
|
||||
|
||||
if (args.conversaId !== undefined) {
|
||||
// Buscar em conversa específica
|
||||
|
||||
Reference in New Issue
Block a user