fix: Suppression d'un profil uniquement s'il ne contient aucun guardian

rattaché à un élève qui n'en a pas d'autre
This commit is contained in:
N3WT DE COMPET
2025-05-03 15:53:19 +02:00
parent ac0672f334
commit 330018edfd
5 changed files with 64 additions and 33 deletions

View File

@ -885,20 +885,9 @@ export default function Page({ params: { locale } }) {
{
name: t('mainContactMail'),
transform: (row) =>
row.student.guardians && row.student.guardians.length > 0 ? (
row.student.guardians && row.student.guardians.length > 0 && (
row.student.guardians[0].associated_profile_email
) : (
<div className="flex justify-center h-full">
<button
className="flex items-center gap-2 text-blue-600 font-semibold hover:text-blue-800 transition duration-200 underline decoration-blue-600 hover:decoration-blue-800"
onClick={() => handleOpenAddGuardian(row.student)}
>
<span className="px-3 py-1 bg-blue-100 rounded-full hover:bg-blue-200 transition duration-200">
Ajouter un responsable
</span>
</button>
</div>
),
)
},
{
name: t('phone'),