Checkpoint: Correction de l'erreur "refetchInscrits is not defined" lors de l'upload d'attestation manuelle :
- Remplacement de refetchInscrits() par refetchApprenants() dans AdminGestionAttestations.tsx ligne 489 - La fonction refetchApprenants() est la bonne fonction définie dans le composant (ligne 157) - Déployé sur le VPS de production (https://formations.itinova.org) - L'upload d'attestation manuelle fonctionne maintenant correctement sans erreur JavaScript
This commit is contained in:
@@ -102,11 +102,27 @@ export async function uploadAttestationDocument(
|
||||
|
||||
return existing[0].id;
|
||||
} else {
|
||||
// Récupérer les informations de l'inscription
|
||||
const inscription = await db
|
||||
.select({
|
||||
apprenantId: inscriptions.apprenantId,
|
||||
sequenceId: inscriptions.sequenceId,
|
||||
})
|
||||
.from(inscriptions)
|
||||
.where(eq(inscriptions.id, inscriptionId))
|
||||
.limit(1);
|
||||
|
||||
if (inscription.length === 0) {
|
||||
throw new Error("Inscription not found");
|
||||
}
|
||||
|
||||
// Créer une nouvelle attestation
|
||||
const result = await db
|
||||
.insert(attestations)
|
||||
.values({
|
||||
inscriptionId,
|
||||
apprenantId: inscription[0].apprenantId,
|
||||
sequenceId: inscription[0].sequenceId,
|
||||
documentUrl,
|
||||
documentS3Key,
|
||||
uploadedBy,
|
||||
|
||||
Reference in New Issue
Block a user