From 31c57d3a2cd77739f25b152897d2e686dcd34cf2 Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:57:35 +0100 Subject: [PATCH] fix: missing ID photo date --- lib/new-admin/graphql/types/customer.type.js | 1 + .../src/pages/Customers/CustomerPhotos.js | 2 +- .../src/pages/Customers/CustomerProfile.js | 4 +++- .../Customers/components/PhotosCarousel.js | 24 +++++++++---------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/new-admin/graphql/types/customer.type.js b/lib/new-admin/graphql/types/customer.type.js index ee85541c..5af0c458 100644 --- a/lib/new-admin/graphql/types/customer.type.js +++ b/lib/new-admin/graphql/types/customer.type.js @@ -20,6 +20,7 @@ const typeDef = gql` idCardPhoto: UploadGQL idCardPhotoPath: String idCardPhotoOverride: String + idCardPhotoAt: Date usSsn: String usSsnOverride: String sanctions: Boolean diff --git a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js index 526da25d..f9b45156 100644 --- a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js +++ b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js @@ -73,7 +73,7 @@ export const PhotoCard = ({
- {date ? format('yyyy-MM-dd', new Date(date)) : 'ID card image'} + {format('yyyy-MM-dd', new Date(date))}
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js index 3a4bbc3f..18cccd18 100644 --- a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js +++ b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js @@ -64,6 +64,7 @@ const GET_CUSTOMER = gql` idCardDataExpiration idCardPhotoPath idCardPhotoOverride + idCardPhotoAt usSsn usSsnOverride sanctions @@ -498,7 +499,8 @@ const CustomerProfile = memo(() => { ? [ { photoDir: 'id-card-photo', - path: customerData.idCardPhotoPath + path: customerData.idCardPhotoPath, + date: customerData.idCardPhotoAt } ] : [] diff --git a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js index 72635092..cfc3901f 100644 --- a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js +++ b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js @@ -38,19 +38,17 @@ const PhotosCarousel = memo(({ photosData, timezone }) => { )}
- {photosData[currentIndex].date && ( - <> - -
- {photosData && - formatDate( - photosData[currentIndex]?.date, - timezone, - 'yyyy-MM-dd HH:mm' - )} -
- - )} + <> + +
+ {photosData && + formatDate( + photosData[currentIndex]?.date, + timezone, + 'yyyy-MM-dd HH:mm' + )} +
+