From ed3546d196cdafe166773318a12b92379448a999 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Fri, 25 Sep 2026 10:52:36 +0200 Subject: [PATCH] fix(#194): insert card_responses avec id_card explicite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeORM nullifiait id_card (conflit Column/JoinColumn) → 500 sur respond. Co-authored-by: Cursor --- backend/src/modules/cards/cards.service.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/src/modules/cards/cards.service.ts b/backend/src/modules/cards/cards.service.ts index 750b68c..5d70403 100644 --- a/backend/src/modules/cards/cards.service.ts +++ b/backend/src/modules/cards/cards.service.ts @@ -204,14 +204,12 @@ export class CardsService { throw new BadRequestException('Motivation obligatoire en cas de refus'); } - await this.responsesRepo.save( - this.responsesRepo.create({ - id_card: card.id, - id_utilisateur: userId, - action: dto.action, - comment: dto.comment?.trim(), - }), - ); + await this.responsesRepo.insert({ + id_card: card.id, + id_utilisateur: userId, + action: dto.action, + comment: dto.comment?.trim() || null, + }); if (card.id_absence) { if (dto.action === CardResponseActionType.ACCEPT || dto.action === CardResponseActionType.ACK) {