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',
|
path: '/vucem',
|
||||||
icon: (
|
icon: (
|
||||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<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';
|
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() {
|
export default function Vucem() {
|
||||||
const [vucemList, setVucemList] = useState([]);
|
const [vucemList, setVucemList] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@@ -51,7 +50,7 @@ export default function Vucem() {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('access');
|
const token = localStorage.getItem('access');
|
||||||
const res = await fetch(API_URL, {
|
const res = await fetch(`${API_URL}/vucem/vucem/`, {
|
||||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||||
});
|
});
|
||||||
if (!res.ok) throw new Error('Error al cargar VUCEM');
|
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);
|
formData.append('is_active', form.is_active);
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('access');
|
const token = localStorage.getItem('access');
|
||||||
const res = await fetch(API_URL, {
|
const res = await fetch(`${API_URL}/vucem/vucem/`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||||
body: formData,
|
body: formData,
|
||||||
@@ -427,7 +426,7 @@ export default function Vucem() {
|
|||||||
formData.append('is_active', form.is_active);
|
formData.append('is_active', form.is_active);
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('access');
|
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',
|
method: 'PATCH',
|
||||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||||
body: formData,
|
body: formData,
|
||||||
@@ -511,7 +510,7 @@ export default function Vucem() {
|
|||||||
if (!deleteVucem) return;
|
if (!deleteVucem) return;
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('access');
|
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',
|
method: 'DELETE',
|
||||||
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user