Modificaiones en la fomrma de renderizar la info
This commit is contained in:
@@ -19,8 +19,8 @@ export default function Cuestionario({ years, admin, updateIsLoading }: Props) {
|
||||
try {
|
||||
//updateIsLoading(true);
|
||||
//const res = await axiosInstance.get(`/cuestionario_alumno?year=${selectedCuestionario}&version=${version}`, {
|
||||
const res = await axiosInstance.get(`/cuestionario_alumno`, {
|
||||
params: { year: selectedYear, version },
|
||||
const res = await axiosInstance.get(`/cuestionario-alumno2`, {
|
||||
params: { anio: selectedYear, version },
|
||||
responseType: "blob",
|
||||
});
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export default function EditarResponsable({
|
||||
|
||||
try {
|
||||
updateIsLoading(true);
|
||||
const res = await axiosInstance.post(`/usuario/new-password-alumno/${idResponsable}`);
|
||||
const res = await axiosInstance.post(`/usuario/new-password-responsable/${idResponsable}`);
|
||||
imprimirMensaje(res.data.message);
|
||||
router.push("/administrador/responsables/responsable");
|
||||
} catch (err: unknown) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import "react-datepicker/dist/react-datepicker.css";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Col, FormGroup, FormLabel, InputGroup } from "react-bootstrap";
|
||||
import { FaRegCalendarAlt, FaUpload } from "react-icons/fa";
|
||||
import { TbFlagSearch } from "react-icons/tb";
|
||||
|
||||
interface Servicio {
|
||||
status: { idStatus?: number };
|
||||
@@ -44,6 +45,9 @@ export default function EditarServicio({
|
||||
imprimirWarning,
|
||||
updateIsLoading,
|
||||
}: Props) {
|
||||
const [selectedInicio, setSelectedInicio] = useState<Date | null>(null);
|
||||
const [selectFechaFin, setSelectedFechaFin] = useState<Date | null>(null);
|
||||
|
||||
const [servicioid, setServicioid] = useState<number>();
|
||||
const [servicio, setServicio] = useState<Servicio>({ status: {} });
|
||||
const [correo, setCorreo] = useState("");
|
||||
@@ -62,6 +66,14 @@ export default function EditarServicio({
|
||||
const fecha = (date?: Date) =>
|
||||
date ? moment(date).format("DD/MM/YYYY") : "";
|
||||
|
||||
const validarFechas = () => {
|
||||
const fechaInicio = moment(selectedInicio);
|
||||
const fechaFin = moment(selectFechaFin);
|
||||
|
||||
if (!fechaInicio.isValid() || !fechaFin.isValid()) return true;
|
||||
return false
|
||||
}
|
||||
|
||||
// Validación de archivos
|
||||
const sizeFileValido = (file: File) => {
|
||||
if (file.size >= 20000000) {
|
||||
@@ -154,10 +166,12 @@ export default function EditarServicio({
|
||||
console.log("Id del servicio para nueva password", data);
|
||||
console.log("Id servicio entrando a la info", data.servicioid)
|
||||
|
||||
//const idServicio ={ idServicio: servicioid }
|
||||
|
||||
try {
|
||||
console.log("Si entro par mandar la solicitud")
|
||||
updateIsLoading(true);
|
||||
const res = await axiosInstance.put(`/usuario/new_password_alumno`, { idServicio: servicioid });
|
||||
const res = await axiosInstance.post(`/usuario/new-password-alumno/${data.servicioid}`);
|
||||
imprimirMensaje(res.data.message);
|
||||
updateIsLoading(false);
|
||||
router.push("/administrador");
|
||||
@@ -200,6 +214,7 @@ export default function EditarServicio({
|
||||
} else {
|
||||
setActualizarFechaFin(true);
|
||||
}
|
||||
|
||||
|
||||
console.log("Esta es la info de servicio", servicio);
|
||||
}, [fechaInicio]);
|
||||
@@ -262,6 +277,7 @@ export default function EditarServicio({
|
||||
<FaRegCalendarAlt />
|
||||
</InputGroup.Text>
|
||||
<DatePicker
|
||||
selected={selectedInicio}
|
||||
onChange={(date: Date | null ) => {
|
||||
if (date) setFechaInicio(date);
|
||||
}}
|
||||
@@ -284,6 +300,7 @@ export default function EditarServicio({
|
||||
<FaRegCalendarAlt />
|
||||
</InputGroup.Text>
|
||||
<DatePicker
|
||||
selected={selectFechaFin}
|
||||
onChange={(date: Date | null) => {
|
||||
if (date) setFechaFin(date);
|
||||
}}
|
||||
|
||||
@@ -68,6 +68,7 @@ export default function TablaResponsables() {
|
||||
className="form-control border-0 rounded-4"
|
||||
value={correo}
|
||||
onChange={(e) => setCorreo(e.target.value)}
|
||||
onKeyDown={(e) => {if (e.key === 'Enter') fetchData(correo)}}
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
@@ -80,6 +81,7 @@ export default function TablaResponsables() {
|
||||
className="form-control border-0 rounded-4"
|
||||
value={nombre}
|
||||
onChange={(e) => setNombre(e.target.value)}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') fetchData(nombre)}}
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
@@ -162,6 +162,7 @@ export default function TablaServicioSocial({ admin, imprimirError }: Props) {
|
||||
value={search.idStatus}
|
||||
onChange={(e) => setSearch(Prev => ({ ...Prev, idStatus: e.target.value }))}
|
||||
className="rounded-4"
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') obtenerServicios()}}
|
||||
>
|
||||
<option value="">Status</option>
|
||||
{status.slice(0, 10).map((s) => (
|
||||
|
||||
@@ -71,13 +71,9 @@ export default function LiberarCasoEspecial({ responsable, imprimirError }: Prop
|
||||
if (search.nombre) query += `&nombre=${search.nombre}`;
|
||||
if (search.numeroCuenta) query += `&numeroCuenta=${search.numeroCuenta}`;
|
||||
|
||||
const res = await axiosInstance.get(`/caso_especial/servicios_especiales?pagina=${page}${query}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${responsable.token}`,
|
||||
},
|
||||
});
|
||||
const res = await axiosInstance.get(`/caso-especial/servicios_especiales?pagina=${page}${query}`);
|
||||
|
||||
setData(res.data.serviciosEspeciales);
|
||||
setData(res.data.data.serviciosEspeciales);
|
||||
setTotal(res.data.count);
|
||||
} catch (err: unknown) {
|
||||
let msg = 'Error al obtener los casos especiales';
|
||||
|
||||
Reference in New Issue
Block a user