feat: update ESLint and TypeScript configurations across frontend and backend; enhance component structure and improve data handling in various modules
This commit is contained in:
@@ -336,7 +336,9 @@ export const listarMinhasSolicitacoes = query({
|
||||
arquivoResposta: s.arquivoResposta ? s.arquivoResposta.toString() : null
|
||||
}));
|
||||
|
||||
console.log(`[listarMinhasSolicitacoes] Usuário: ${usuario._id}, Solicitações encontradas: ${resultado.length}`);
|
||||
console.log(
|
||||
`[listarMinhasSolicitacoes] Usuário: ${usuario._id}, Solicitações encontradas: ${resultado.length}`
|
||||
);
|
||||
return resultado;
|
||||
} catch (error) {
|
||||
console.error('[listarMinhasSolicitacoes] Erro ao listar minhas solicitações:', error);
|
||||
@@ -544,11 +546,7 @@ export const responderSolicitacao = mutation({
|
||||
args: {
|
||||
solicitacaoId: v.id('solicitacoesLGPD'),
|
||||
resposta: v.string(),
|
||||
status: v.union(
|
||||
v.literal('concluida'),
|
||||
v.literal('rejeitada'),
|
||||
v.literal('em_analise')
|
||||
),
|
||||
status: v.union(v.literal('concluida'), v.literal('rejeitada'), v.literal('em_analise')),
|
||||
arquivoResposta: v.optional(v.id('_storage'))
|
||||
},
|
||||
returns: v.object({ sucesso: v.boolean() }),
|
||||
@@ -895,9 +893,12 @@ export const atualizarConfiguracaoLGPD = mutation({
|
||||
await ctx.db.insert('configuracaoLGPD', {
|
||||
encarregadoNome: args.encarregadoNome ?? valoresAtuais.encarregadoNome ?? undefined,
|
||||
encarregadoEmail: args.encarregadoEmail ?? valoresAtuais.encarregadoEmail ?? undefined,
|
||||
encarregadoTelefone: args.encarregadoTelefone ?? valoresAtuais.encarregadoTelefone ?? undefined,
|
||||
encarregadoTelefone:
|
||||
args.encarregadoTelefone ?? valoresAtuais.encarregadoTelefone ?? undefined,
|
||||
encarregadoHorarioAtendimento:
|
||||
args.encarregadoHorarioAtendimento ?? valoresAtuais.encarregadoHorarioAtendimento ?? undefined,
|
||||
args.encarregadoHorarioAtendimento ??
|
||||
valoresAtuais.encarregadoHorarioAtendimento ??
|
||||
undefined,
|
||||
prazoRespostaPadrao: args.prazoRespostaPadrao ?? valoresAtuais.prazoRespostaPadrao,
|
||||
diasAlertaVencimento: args.diasAlertaVencimento ?? valoresAtuais.diasAlertaVencimento,
|
||||
termoObrigatorio: args.termoObrigatorio ?? valoresAtuais.termoObrigatorio ?? false,
|
||||
@@ -944,11 +945,10 @@ export const obterEstatisticasLGPD = query({
|
||||
const agora = Date.now();
|
||||
const tresDias = 3 * 24 * 60 * 60 * 1000;
|
||||
|
||||
const solicitacoesVencendo = solicitacoes.filter(
|
||||
(s) =>
|
||||
s.status === 'pendente' || s.status === 'em_analise'
|
||||
? s.prazoResposta - agora <= tresDias && s.prazoResposta > agora
|
||||
: false
|
||||
const solicitacoesVencendo = solicitacoes.filter((s) =>
|
||||
s.status === 'pendente' || s.status === 'em_analise'
|
||||
? s.prazoResposta - agora <= tresDias && s.prazoResposta > agora
|
||||
: false
|
||||
).length;
|
||||
|
||||
const solicitacoesPorTipo: Record<string, number> = {};
|
||||
@@ -956,9 +956,7 @@ export const obterEstatisticasLGPD = query({
|
||||
solicitacoesPorTipo[s.tipo] = (solicitacoesPorTipo[s.tipo] || 0) + 1;
|
||||
});
|
||||
|
||||
const consentimentosAtivos = consentimentos.filter(
|
||||
(c) => c.aceito && !c.revogadoEm
|
||||
).length;
|
||||
const consentimentosAtivos = consentimentos.filter((c) => c.aceito && !c.revogadoEm).length;
|
||||
|
||||
return {
|
||||
totalSolicitacoes: solicitacoes.length,
|
||||
@@ -972,4 +970,3 @@ export const obterEstatisticasLGPD = query({
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user