Se modifico formulario de actualizazcion
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { fetchWithAuth, postWithAuth, putWithAuth, deleteWithAuth } from '../fetchWithAuth';
|
||||
import { fetchWithAuth, postWithAuth, putWithAuth, deleteWithAuth, putFormDataWithAuth, postFormDataWithAuth } from '../fetchWithAuth';
|
||||
|
||||
const API_URL = import.meta.env.VITE_EFC_API_URL;
|
||||
export default function Vucem() {
|
||||
@@ -931,7 +931,7 @@ export default function Vucem() {
|
||||
formData.append('acuseedocument', form.acuseedocument);
|
||||
formData.append('is_active', form.is_active);
|
||||
try {
|
||||
const res = await postWithAuth(`${API_URL}/vucem/vucem/`, formData);
|
||||
const res = await postFormDataWithAuth(`${API_URL}/vucem/vucem/`, formData);
|
||||
if (!res.ok) throw new Error('Error al crear VUCEM');
|
||||
await fetchVucem();
|
||||
closeModals();
|
||||
@@ -1095,7 +1095,7 @@ export default function Vucem() {
|
||||
formData.append('acuseedocument', form.acuseedocument);
|
||||
formData.append('is_active', form.is_active);
|
||||
try {
|
||||
const res = await putWithAuth(`${API_URL}/vucem/vucem/${editVucem.id}/`, formData);
|
||||
const res = await putFormDataWithAuth(`${API_URL}/vucem/vucem/${editVucem.id}/`, formData);
|
||||
if (!res.ok) throw new Error('Error al actualizar VUCEM');
|
||||
await fetchVucem();
|
||||
closeModals();
|
||||
|
||||
Reference in New Issue
Block a user