Skip to content

Commit

Permalink
refactor: move salvar
Browse files Browse the repository at this point in the history
  • Loading branch information
Natyrodrigues committed Aug 31, 2024
1 parent 9a64fa0 commit 9649dc8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/private/pages/cadastrarIdoso.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ export default function CadastrarIdoso() {
}
};

const salvar = async () => {
if (Object.keys(erros).length > 0) {
setShowErrors(true);
return;
}

const metricas = [
{ key: EMetricas.FREQ_CARDIACA, value: EMetricas.FREQ_CARDIACA },
{ key: EMetricas.GLICEMIA, value: EMetricas.GLICEMIA },
Expand All @@ -143,12 +149,6 @@ export default function CadastrarIdoso() {
{ key: EMetricas.HIDRATACAO, value: EMetricas.HIDRATACAO },
];

const salvar = async () => {
if (Object.keys(erros).length > 0) {
setShowErrors(true);
return;
}

const body = {
idUsuario: idUsuario as number,
nome,
Expand Down

0 comments on commit 9649dc8

Please sign in to comment.