From f57108c38ed1018a065f0fb4035017f558886746 Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Thu, 14 Sep 2023 05:24:04 +0200 Subject: [PATCH] fix: createdAt in history --- dashboard/src/components/ActionModal.js | 20 ++++++++++--------- dashboard/src/components/ConsultationModal.js | 20 ++++++++++--------- .../scenes/person/components/PersonHistory.js | 20 ++++++++++--------- .../person/components/TreatmentModal.js | 20 ++++++++++--------- 4 files changed, 44 insertions(+), 36 deletions(-) diff --git a/dashboard/src/components/ActionModal.js b/dashboard/src/components/ActionModal.js index 7dcb46864..971c67a34 100644 --- a/dashboard/src/components/ActionModal.js +++ b/dashboard/src/components/ActionModal.js @@ -758,15 +758,17 @@ function ActionHistory({ action }) { ); })} - - {dayjsInstance(action.createdAt).format('DD/MM/YYYY HH:mm')} - - - - -

Création de l'action

- - + {!!action?.createdAt && ( + + {dayjsInstance(action.createdAt).format('DD/MM/YYYY HH:mm')} + + + + +

Création de l'action

+ + + )} diff --git a/dashboard/src/components/ConsultationModal.js b/dashboard/src/components/ConsultationModal.js index ff661eeb4..1da18034b 100644 --- a/dashboard/src/components/ConsultationModal.js +++ b/dashboard/src/components/ConsultationModal.js @@ -654,15 +654,17 @@ function ConsultationHistory({ consultation }) { ); })} - - {dayjsInstance(consultation.createdAt).format('DD/MM/YYYY HH:mm')} - - - - -

Création de la consultation

- - + {consultation?.createdAt && ( + + {dayjsInstance(consultation.createdAt).format('DD/MM/YYYY HH:mm')} + + + + +

Création de la consultation

+ + + )} diff --git a/dashboard/src/scenes/person/components/PersonHistory.js b/dashboard/src/scenes/person/components/PersonHistory.js index 61e6813c4..7c88db924 100644 --- a/dashboard/src/scenes/person/components/PersonHistory.js +++ b/dashboard/src/scenes/person/components/PersonHistory.js @@ -130,15 +130,17 @@ export default function PersonHistory({ person }) { ); })} - - {dayjsInstance(person.createdAt).format('DD/MM/YYYY HH:mm')} - - - - -

Création de la personne

- - + {person?.createdAt && ( + + {dayjsInstance(person.createdAt).format('DD/MM/YYYY HH:mm')} + + + + +

Création de la personne

+ + + )} diff --git a/dashboard/src/scenes/person/components/TreatmentModal.js b/dashboard/src/scenes/person/components/TreatmentModal.js index f8f97bb05..cbf76c8ac 100644 --- a/dashboard/src/scenes/person/components/TreatmentModal.js +++ b/dashboard/src/scenes/person/components/TreatmentModal.js @@ -521,15 +521,17 @@ function TreatmentHistory({ treatment }) { ); })} - - {dayjsInstance(treatment.createdAt).format('DD/MM/YYYY HH:mm')} - - - - -

Création du traitement

- - + {!!treatment?.createdAt && ( + + {dayjsInstance(treatment.createdAt).format('DD/MM/YYYY HH:mm')} + + + + +

Création du traitement

+ + + )}