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,
|
contenu: string,
|
||||||
tache: string,
|
tache: string,
|
||||||
profile: AuthProfile
|
profile: AuthProfile
|
||||||
): Promise<{ data: EERapport } | CorrectionError> {
|
): Promise<{ data: EERapport & { simulation_id: string } } | CorrectionError> {
|
||||||
// 1. Vérifier que la production existe et appartient à l'utilisateur
|
// 1. Vérifier que la production existe et appartient à l'utilisateur
|
||||||
const { data: production, error: fetchError } = await supabase
|
const { data: production, error: fetchError } = await supabase
|
||||||
.from('productions')
|
.from('productions')
|
||||||
|
|
@ -73,8 +73,8 @@ export async function correctEE(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Retourner le rapport complet
|
// 4. Retourner le rapport complet enrichi avec simulation_id
|
||||||
return { data: rapport }
|
return { data: { ...rapport, simulation_id: simulationId } }
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function correctEO(
|
export async function correctEO(
|
||||||
|
|
@ -82,7 +82,7 @@ export async function correctEO(
|
||||||
transcript: string,
|
transcript: string,
|
||||||
tache: string,
|
tache: string,
|
||||||
profile: AuthProfile
|
profile: AuthProfile
|
||||||
): Promise<{ data: EORapport } | CorrectionError> {
|
): Promise<{ data: EORapport & { simulation_id: string } } | CorrectionError> {
|
||||||
// 1. Vérifier que la production existe et appartient à l'utilisateur
|
// 1. Vérifier que la production existe et appartient à l'utilisateur
|
||||||
const { data: production, error: fetchError } = await supabase
|
const { data: production, error: fetchError } = await supabase
|
||||||
.from('productions')
|
.from('productions')
|
||||||
|
|
@ -141,6 +141,6 @@ export async function correctEO(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Retourner le rapport complet
|
// 4. Retourner le rapport complet enrichi avec simulation_id
|
||||||
return { data: rapport }
|
return { data: { ...rapport, simulation_id: simulationId } }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue