Se realizaron cambios en el modulo de ventanilla unica
This commit is contained in:
@@ -163,7 +163,7 @@ export default function Sidebar() {
|
||||
]
|
||||
),
|
||||
{
|
||||
name: 'Vucem',
|
||||
name: 'Ventanilla Única',
|
||||
path: '/vucem',
|
||||
icon: (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
const API_URL = 'http://192.168.1.195:8000/api/v1/vucem/vucem/';
|
||||
|
||||
const API_URL = import.meta.env.VITE_EFC_API_URL;
|
||||
export default function Vucem() {
|
||||
const [vucemList, setVucemList] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -51,7 +50,7 @@ export default function Vucem() {
|
||||
setLoading(true);
|
||||
try {
|
||||
const token = localStorage.getItem('access');
|
||||
const res = await fetch(API_URL, {
|
||||
const res = await fetch(`${API_URL}/vucem/vucem/`, {
|
||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||
});
|
||||
if (!res.ok) throw new Error('Error al cargar VUCEM');
|
||||
@@ -341,7 +340,7 @@ export default function Vucem() {
|
||||
formData.append('is_active', form.is_active);
|
||||
try {
|
||||
const token = localStorage.getItem('access');
|
||||
const res = await fetch(API_URL, {
|
||||
const res = await fetch(`${API_URL}/vucem/vucem/`, {
|
||||
method: 'POST',
|
||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||
body: formData,
|
||||
@@ -427,7 +426,7 @@ export default function Vucem() {
|
||||
formData.append('is_active', form.is_active);
|
||||
try {
|
||||
const token = localStorage.getItem('access');
|
||||
const res = await fetch(`${API_URL}${editVucem.id}/`, {
|
||||
const res = await fetch(`${API_URL}/vucem/vucem/${editVucem.id}/`, {
|
||||
method: 'PATCH',
|
||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||
body: formData,
|
||||
@@ -511,7 +510,7 @@ export default function Vucem() {
|
||||
if (!deleteVucem) return;
|
||||
try {
|
||||
const token = localStorage.getItem('access');
|
||||
const res = await fetch(`${API_URL}${deleteVucem.id}/`, {
|
||||
const res = await fetch(`${API_URL}/vucem/vucem/${deleteVucem.id}/`, {
|
||||
method: 'DELETE',
|
||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user