feat(corrections): enrichir réponse avec simulation_id
This commit is contained in:
parent
f67bd2dc95
commit
6ca2412304
1 changed files with 6 additions and 6 deletions
|
|
@ -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 } }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue