feat(corrections): enrichir réponse avec simulation_id

This commit is contained in:
Hermann_Kitio 2026-04-20 04:31:57 +03:00
parent f67bd2dc95
commit 6ca2412304

View file

@ -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 } }
}