Checkpoint: Correction critique : préservation des signatures lors de l'ajout/modification de dates dans une séquence - Remplacement de la logique de suppression/recréation par une mise à jour intelligente
This commit is contained in:
16
server/db.ts
16
server/db.ts
@@ -329,6 +329,22 @@ export async function deleteDatesBySequence(sequenceId: number) {
|
||||
await db.delete(datesFormation).where(eq(datesFormation.sequenceId, sequenceId));
|
||||
}
|
||||
|
||||
export async function updateDateFormation(id: number, data: Partial<InsertDateFormation>) {
|
||||
const db = await getDb();
|
||||
if (!db) throw new Error("Database not available");
|
||||
|
||||
await db.update(datesFormation)
|
||||
.set(data)
|
||||
.where(eq(datesFormation.id, id));
|
||||
}
|
||||
|
||||
export async function deleteDateFormation(id: number) {
|
||||
const db = await getDb();
|
||||
if (!db) throw new Error("Database not available");
|
||||
|
||||
await db.delete(datesFormation).where(eq(datesFormation.id, id));
|
||||
}
|
||||
|
||||
// ==================== APPRENANTS ====================
|
||||
|
||||
export async function createApprenant(data: InsertApprenant) {
|
||||
|
||||
Reference in New Issue
Block a user