Skip to content

Commit 37b44e9

Browse files
committed
fix(backend): fix delete of a decision
1 parent 41f3eca commit 37b44e9

File tree

3 files changed

+6
-253
lines changed

3 files changed

+6
-253
lines changed

packages/backend/src/_migrations/1748860978115-auto-migration.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/backend/src/_migrations/1748860978116-encrypt-structure-docs-migration.ts

Lines changed: 0 additions & 230 deletions
This file was deleted.

packages/backend/src/usagers/controllers/usagers-decision.controller.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ export class UsagersDecisionController {
165165
};
166166

167167
await usagerNotesRepository.save(newNote);
168-
169168
await usagerRepository.update(
170169
{ uuid: usager.uuid },
171170
{
@@ -188,7 +187,12 @@ export class UsagersDecisionController {
188187
let strDecision = `Suppression de la décision : \n ${
189188
USAGER_DECISION_STATUT_LABELS_PROFIL[decision.statut]
190189
}`;
191-
const dateDebut = format(new Date(decision.dateDebut), "dd/MM/yyyy");
190+
191+
const dateRef = decision?.dateDebut
192+
? decision.dateDebut
193+
: decision.dateDecision;
194+
195+
const dateDebut = format(new Date(dateRef), "dd/MM/yyyy");
192196

193197
if (decision.statut === "VALIDE") {
194198
const dateFin = format(new Date(decision.dateFin), "dd/MM/yyyy");

0 commit comments

Comments
 (0)