From 0be08db48ce257a9977febb53abef08ca1d45c65 Mon Sep 17 00:00:00 2001 From: Sr-Iury Date: Mon, 2 Dec 2024 22:11:31 -0300 Subject: [PATCH 1/2] fix: correction in the discipline image registration field :bug: there was a correction of the image GET error by image SET that hindered the registration of disxiplinas --- components/Section/Disciplinas/Form/Form.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/Section/Disciplinas/Form/Form.vue b/components/Section/Disciplinas/Form/Form.vue index 3ca469b..06def7a 100644 --- a/components/Section/Disciplinas/Form/Form.vue +++ b/components/Section/Disciplinas/Form/Form.vue @@ -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; @@ -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!'), @@ -107,8 +105,11 @@ const onSubmit = handleSubmit(async (values: FormOutput) => { } if (imagem) { - await apiClient.disciplinas.disciplinaGetImagemCapa({ + await apiClient.disciplinas.disciplinaSetImagemCapa({ id: id, + formData: { + file: imagem, + }, }); } From 43e682975ba299a48341d610e70022d37cfe5213 Mon Sep 17 00:00:00 2001 From: Sr-Iury Date: Mon, 2 Dec 2024 22:19:11 -0300 Subject: [PATCH 2/2] fix: correction in updating the subject image :bug: --- components/Section/Disciplinas/Form/Form.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/Section/Disciplinas/Form/Form.vue b/components/Section/Disciplinas/Form/Form.vue index 06def7a..bdc06db 100644 --- a/components/Section/Disciplinas/Form/Form.vue +++ b/components/Section/Disciplinas/Form/Form.vue @@ -95,9 +95,8 @@ const onSubmit = handleSubmit(async (values: FormOutput) => { } else { await apiClient.disciplinas.disciplinaUpdateOneById({ id: editId, - requestBody: { - ...values, + ...data, }, });