fix: correction des redirections vers la login page

This commit is contained in:
Luc SORIGNET
2025-04-17 17:23:17 +02:00
parent f7666c894b
commit 2e0fe86c71
6 changed files with 44 additions and 48 deletions

View File

@ -8,6 +8,7 @@ import { Search } from 'lucide-react';
import Popup from '@/components/Popup';
import Loader from '@/components/Loader';
import AlertWithModal from '@/components/AlertWithModal';
import { useRouter } from 'next/navigation';
import DropdownMenu from '@/components/DropdownMenu';
import {
MoreVertical,
@ -112,6 +113,7 @@ export default function Page({ params: { locale } }) {
const [isOpenAddGuardian, setIsOpenAddGuardian] = useState(false);
const csrfToken = useCsrfToken();
const router = useRouter();
const { selectedEstablishmentId } = useEstablishment();
const openModal = () => {
@ -670,7 +672,9 @@ export default function Page({ params: { locale } }) {
{
icon: <Edit className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
onClick: () =>
(window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`),
router.push(
`${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}`
),
},
{
icon: (
@ -688,7 +692,9 @@ export default function Page({ params: { locale } }) {
{
icon: <Edit className="w-5 h-5 text-blue-500 hover:text-blue-700" />,
onClick: () =>
(window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}&id=1`),
router.push(
`${FE_ADMIN_SUBSCRIPTIONS_EDIT_URL}?studentId=${row.student.id}`
),
},
],
3: [
@ -697,7 +703,9 @@ export default function Page({ params: { locale } }) {
<CircleCheck className="w-5 h-5 text-green-500 hover:text-green-700" />
),
onClick: () =>
(window.location.href = `${FE_ADMIN_SUBSCRIPTIONS_VALIDATE_URL}?studentId=${row.student.id}&firstName=${row.student.first_name}&lastName=${row.student.last_name}&paymentMode=${row.registration_payment}&file=${row.registration_file}`),
router.push(
`${FE_ADMIN_SUBSCRIPTIONS_VALIDATE_URL}?studentId=${row.student.id}&firstName=${row.student.first_name}&lastName=${row.student.last_name}&paymentMode=${row.registration_payment}&file=${row.registration_file}`
),
},
],
5: [