Skip to content

Commit

Permalink
Merge pull request #373 from ladesa-ro/Ajuste-Disciplinas
Browse files Browse the repository at this point in the history
Ajuste disciplinas
  • Loading branch information
guesant authored Dec 3, 2024
2 parents 77e005a + 43e6829 commit 4d3f23e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/Section/Disciplinas/Form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const $emit = defineEmits(['close']);
const apiClient = useApiClient();
const queryClient = useQueryClient();
const { disciplina: currentDisciplina } =
await useApiDisciplinasFindOne(editIdRef);
const { disciplina: currentDisciplina } = await useApiDisciplinasFindOne(editIdRef);
type FormValues = {
imagem: Blob | null | undefined;
Expand Down Expand Up @@ -66,7 +65,6 @@ const handleDelete = async () => {
const schema = yup.object().shape({
imagem: yup.mixed().nullable().optional(),
nome: yup.string().required('Nome é obrigatório!'),
nomeAbreviado: yup.string().required('Nome abreviado é obrigatório!'),
cargaHoraria: yup.string().required('Carga horária é obrigatória!'),
Expand Down Expand Up @@ -97,18 +95,20 @@ const onSubmit = handleSubmit(async (values: FormOutput) => {
} else {
await apiClient.disciplinas.disciplinaUpdateOneById({
id: editId,
requestBody: {
...values,
...data,
},
});
id = editId;
}
if (imagem) {
await apiClient.disciplinas.disciplinaGetImagemCapa({
await apiClient.disciplinas.disciplinaSetImagemCapa({
id: id,
formData: {
file: imagem,
},
});
}
Expand Down

0 comments on commit 4d3f23e

Please sign in to comment.