diff --git a/src/controllers/correctionController.ts b/src/controllers/correctionController.ts index 06919bf..d8182e4 100644 --- a/src/controllers/correctionController.ts +++ b/src/controllers/correctionController.ts @@ -15,7 +15,7 @@ export async function correctEE( contenu: string, tache: string, profile: AuthProfile -): Promise<{ data: EERapport } | CorrectionError> { +): Promise<{ data: EERapport & { simulation_id: string } } | CorrectionError> { // 1. Vérifier que la production existe et appartient à l'utilisateur const { data: production, error: fetchError } = await supabase .from('productions') @@ -73,8 +73,8 @@ export async function correctEE( } } - // 4. Retourner le rapport complet - return { data: rapport } + // 4. Retourner le rapport complet enrichi avec simulation_id + return { data: { ...rapport, simulation_id: simulationId } } } export async function correctEO( @@ -82,7 +82,7 @@ export async function correctEO( transcript: string, tache: string, profile: AuthProfile -): Promise<{ data: EORapport } | CorrectionError> { +): Promise<{ data: EORapport & { simulation_id: string } } | CorrectionError> { // 1. Vérifier que la production existe et appartient à l'utilisateur const { data: production, error: fetchError } = await supabase .from('productions') @@ -141,6 +141,6 @@ export async function correctEO( } } - // 4. Retourner le rapport complet - return { data: rapport } + // 4. Retourner le rapport complet enrichi avec simulation_id + return { data: { ...rapport, simulation_id: simulationId } } }