fix(#168): typage colonne placement garde courant compatible TypeORM.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -28,14 +28,14 @@ export class Parents {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Placement AM↔enfant sélectionné sur le TdB parent (couple actif) — ticket #168.
|
* Placement AM↔enfant sélectionné sur le TdB parent (couple actif) — ticket #168.
|
||||||
* Null = le front prend le premier couple actif retourné par l’API.
|
* Null / absent = le front prend le premier couple actif retourné par l’API.
|
||||||
*/
|
*/
|
||||||
@Column({ name: 'id_placement_garde_courant', type: 'uuid', nullable: true })
|
@Column({ name: 'id_placement_garde_courant', type: 'uuid', nullable: true })
|
||||||
id_placement_garde_courant?: string | null;
|
id_placement_garde_courant?: string;
|
||||||
|
|
||||||
@ManyToOne(() => AmChildren, { nullable: true, onDelete: 'SET NULL' })
|
@ManyToOne(() => AmChildren, { nullable: true, onDelete: 'SET NULL' })
|
||||||
@JoinColumn({ name: 'id_placement_garde_courant', referencedColumnName: 'id' })
|
@JoinColumn({ name: 'id_placement_garde_courant', referencedColumnName: 'id' })
|
||||||
placement_garde_courant?: AmChildren | null;
|
placement_garde_courant?: AmChildren;
|
||||||
|
|
||||||
// Lien vers enfants via la table enfants_parents
|
// Lien vers enfants via la table enfants_parents
|
||||||
@OneToMany(() => ParentsChildren, pc => pc.parent)
|
@OneToMany(() => ParentsChildren, pc => pc.parent)
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ export class ParentsService {
|
|||||||
idCourant = null;
|
idCourant = null;
|
||||||
await this.parentsRepository.update(
|
await this.parentsRepository.update(
|
||||||
{ user_id: parentUserId },
|
{ user_id: parentUserId },
|
||||||
{ id_placement_garde_courant: null },
|
{ id_placement_garde_courant: () => 'NULL' },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!idCourant && placements.length === 1) {
|
if (!idCourant && placements.length === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user