Skip to content

Commit

Permalink
fix: not mapped value
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Aug 21, 2024
1 parent af00b94 commit 56a2bd8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const validateSigaaComponents = z.object({
periodo: z.string(),
codigo: z.string(),
situacao: z
.enum(['APROVADO', 'REPROVADO', 'REPROVADO POR FALTAS', '--'])
.enum(['APROVADO', 'REPROVADO', 'REPROVADO POR FALTAS', '--', ''])
.transform((situation) => situation.toLocaleLowerCase()),
disciplina: z.string().transform((name) => name.trim().toLocaleLowerCase()),
resultado: z.enum(['A', 'B', 'C', 'D', 'E', 'F', 'O', '--']),
resultado: z.enum(['A', 'B', 'C', 'D', 'E', 'F', 'O', '--', '']),
});

const validateSigaaHistory = z.object({
Expand Down Expand Up @@ -134,9 +134,9 @@ async function hydrateComponents(component: StudentComponent, ra: number) {
}

return {
conceito: component.resultado === '--' ? null : component.resultado,
conceito: component.resultado === '--' || '' ? null : component.resultado,
periodo: component.periodo,
situacao: component.situacao === '--' ? null : component.situacao,
situacao: component.situacao === '--' || '' ? null : component.situacao,
ano: component.ano,
codigo: component.codigo,
creditos: validComponent.credits,
Expand Down

0 comments on commit 56a2bd8

Please sign in to comment.