Se realizaron cambios en el modulo de ventanilla unica

This commit is contained in:
2025-08-04 22:15:22 -06:00
parent 01b809beb2
commit 17b5143032
2 changed files with 6 additions and 7 deletions

View File

@@ -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">

View File

@@ -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}` } : {},
});