fix(#194): insert card_responses avec id_card explicite
TypeORM nullifiait id_card (conflit Column/JoinColumn) → 500 sur respond. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -204,14 +204,12 @@ export class CardsService {
|
|||||||
throw new BadRequestException('Motivation obligatoire en cas de refus');
|
throw new BadRequestException('Motivation obligatoire en cas de refus');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.responsesRepo.save(
|
await this.responsesRepo.insert({
|
||||||
this.responsesRepo.create({
|
id_card: card.id,
|
||||||
id_card: card.id,
|
id_utilisateur: userId,
|
||||||
id_utilisateur: userId,
|
action: dto.action,
|
||||||
action: dto.action,
|
comment: dto.comment?.trim() || null,
|
||||||
comment: dto.comment?.trim(),
|
});
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (card.id_absence) {
|
if (card.id_absence) {
|
||||||
if (dto.action === CardResponseActionType.ACCEPT || dto.action === CardResponseActionType.ACK) {
|
if (dto.action === CardResponseActionType.ACCEPT || dto.action === CardResponseActionType.ACK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user