diff --git a/backend/src/modules/documents-legaux/documents-legaux.controller.ts b/backend/src/modules/documents-legaux/documents-legaux.controller.ts index 0bef1e8..6955bad 100644 --- a/backend/src/modules/documents-legaux/documents-legaux.controller.ts +++ b/backend/src/modules/documents-legaux/documents-legaux.controller.ts @@ -101,8 +101,9 @@ export class DocumentsLegauxController { throw new BadRequestException('Aucun fichier fourni'); } - // TODO: Récupérer l'ID utilisateur depuis le guard - const userId = '00000000-0000-0000-0000-000000000000'; // Temporaire + // TODO: Récupérer l'ID utilisateur depuis le guard quand l'auth sera branchée. + // En attendant, on n'associe pas d'utilisateur plutôt que d'envoyer un UUID fictif invalide. + const userId: string | null = null; const document = await this.documentsService.uploadNouvelleVersion( uploadDto.type, diff --git a/backend/src/modules/documents-legaux/documents-legaux.service.ts b/backend/src/modules/documents-legaux/documents-legaux.service.ts index 02ce74b..3ea05e3 100644 --- a/backend/src/modules/documents-legaux/documents-legaux.service.ts +++ b/backend/src/modules/documents-legaux/documents-legaux.service.ts @@ -43,7 +43,7 @@ export class DocumentsLegauxService { async uploadNouvelleVersion( type: 'cgu' | 'privacy', file: Express.Multer.File, - userId: string, + userId?: string | null, ): Promise { // Validation du type de fichier if (file.mimetype !== 'application/pdf') { @@ -84,7 +84,7 @@ export class DocumentsLegauxService { fichier_path: filePath, fichier_hash: hash, actif: false, // Pas actif par défaut - televersePar: { id: userId } as any, + televersePar: userId ? ({ id: userId } as any) : null, televerseLe: new Date(), });