Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuop committed Oct 9, 2024
1 parent ec660ec commit f6bf56d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FrontAdmin/src/API/Montos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const loadPDF = async (id :string,file: File) => {
const formData = new FormData();
formData.append('archivo_pdf', file);

const response = await fetch(`${URL}/compromisos/${id}/`, {
const response = await fetch(`http://localhost:8000/api/compromisos/${id}/`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${token}`,
Expand Down
4 changes: 2 additions & 2 deletions FrontAdmin/src/API/Sysacad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const FetchExcel = async (excelFile: File) => {
formData.append('file', excelFile);

const response = await fetch(
`http://localhost:8000/api/excels/`,
`http://localhost:8000/api/excels/sysacad/`,
{
method: 'POST',
headers: {
Expand Down Expand Up @@ -37,7 +37,7 @@ export const FetchHistorialExcel = async () => {
const token = Cookies.get('tokennn');

const response = await fetch(
'http://localhost:8000/api/excels/',
'http://localhost:8000/api/excels/sysacad/',
{
method: 'GET',
headers: {
Expand Down
5 changes: 4 additions & 1 deletion FrontAdmin/src/Context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ interface AuthContextType {
const AuthContext = createContext<AuthContextType | undefined>(undefined);

const AuthProvider = ({ children }: { children: ReactNode }) => {
const [rolUser, setRolUser] = useState<String[]>(JSON.parse(localStorage.getItem('userRol') || '[]'));
const [rolUser, setRolUser] = useState<String[]>(() => {

Check failure on line 16 in FrontAdmin/src/Context.tsx

View workflow job for this annotation

GitHub Actions / Linter de Código

Don't use `String` as a type. Use string instead
const storedUserRol = localStorage.getItem('userRol');
return storedUserRol ? JSON.parse(storedUserRol) : [];
});
const [isAuthenticated, setIsAuthenticated] = useState(
(!Cookies.get('tokennn') ) ? false : true
);
Expand Down
10 changes: 10 additions & 0 deletions FrontAdmin/src/components/Pages/SysAdmin/SysAdmin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Grid, Text, Stack } from '@chakra-ui/react';
import { Tabs, TabList, TabPanels, Tab, TabPanel, Box } from '@chakra-ui/react'

function Sysadmin() {
return (
<></>
);
}

export default Sysadmin;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function CargaExcel() {
setIsLoading(true);
const token = Cookies.get('tokennn');
const response = await fetch(
`http://localhost:8000/api/excels/`,
`http://localhost:8000/api/excels/sysacad/`,
{
method: 'POST',
headers: {
Expand Down
3 changes: 2 additions & 1 deletion FrontAdmin/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Select from './components/Pages/Estadisticas/SubPages/Cuotas/Select';
import Listado from './components/Pages/Estadisticas/SubPages/Cuotas/Listado';
import path from 'path';
import EstadoCuenta from './components/Pages-Alumnos/EstadoCuenta/EstadoCuenta';
import Sysadmin from './components/Pages/SysAdmin/SysAdmin';

const routes = [
{
Expand Down Expand Up @@ -81,7 +82,7 @@ const routes = [
{
path: 'sysadmin',
title: 'SysAdmin',
element: <ErrorPage />,
element: <Sysadmin/>,
icon: iconSysAdmin,
rol: 'admin',
},
Expand Down

0 comments on commit f6bf56d

Please sign in to comment.