Skip to content

Commit

Permalink
:)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuop committed Oct 9, 2024
1 parent 737347d commit 8476528
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FrontAdmin/src/components/Pages/SysAdmin/SysAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ useEffect(() => {


return (
<Stack direction="column" align="center">
<Stack direction="column" align="center" mt={"20px"}>
<Stack direction="column" spacing={4} align="center" bg="secundaryBg" padding={5} borderRadius={10} w={550}>
<Text fontSize="xl">Subir Excel de SysAdmin</Text>
<ZonaCarga
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function CargaExcel() {
const [data, setData] = useState<string[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [excels, setExcels] = useState<any[]>([]);
const [bandera, setBandera] = useState(false);

const handleFileUpload = (fileName: string) => {
setFileUploaded(true);
Expand Down Expand Up @@ -49,6 +50,7 @@ function CargaExcel() {
} catch (error: any) {
console.error('Error al subir el archivo:', error);
} finally {
setBandera(!bandera);
setIsLoading(false);
}
};
Expand All @@ -70,13 +72,14 @@ function CargaExcel() {
const getHistorial = async () => {
try {
const historial = await FetchHistorialExcel();
historial.sort((a: any, b: any) => b.id - a.id); // Ordenar en forma descendente por id
setExcels(historial);
} catch (error) {
console.error('Error:', error);
}
};
getHistorial();
}, []);
}, [bandera]);

const extractDateFromUrl = (url: string) => {
const regex = /(\d{4}_\d{2}_\d{2}_\d{2})/;
Expand Down Expand Up @@ -156,4 +159,4 @@ function CargaExcel() {
);
}

export default CargaExcel;
export default CargaExcel;

0 comments on commit 8476528

Please sign in to comment.