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

@@ -2,7 +2,7 @@ import { v } from "convex/values";
import { mutation, query } from "./_generated/server";
import { hashPassword, generateToken } from "./auth/utils";
import { registrarAtividade } from "./logsAtividades";
import { Id } from "./_generated/dataModel";
import { Id, Doc } from "./_generated/dataModel";
import { api } from "./_generated/api";
/**
@@ -436,7 +436,7 @@ export const atualizarPerfil = mutation({
}
// Atualizar apenas os campos fornecidos
const updates: any = { atualizadoEm: Date.now() };
const updates: Partial<Doc<"usuarios">> & { atualizadoEm: number } = { atualizadoEm: Date.now() };
if (args.avatar !== undefined) updates.avatar = args.avatar;
if (args.fotoPerfil !== undefined) updates.fotoPerfil = args.fotoPerfil;
@@ -882,7 +882,7 @@ export const editarUsuario = mutation({
}
// Atualizar campos fornecidos
const updates: any = {
const updates: Partial<Doc<"usuarios">> & { atualizadoEm: number } = {
atualizadoEm: Date.now(),
};