You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve Prisma alunoId for ALUNO role to avoid FK violation
getAuthRole() returns role=null for ALUNO (no funcionarios record).
Previous code used auth user.id as alunoId, but Prisma aluno.id
may differ from Supabase Auth UUID. Added resolveAlunoId() helper
that looks up the correct aluno.id by email before create.
Fixes: foreign key constraint violation on treinos_alunoId_fkey
when ALUNO saves AI-generated workout.
0 commit comments