From 9f428f0c474c3c065f03668454bd0edb9d282e2b Mon Sep 17 00:00:00 2001 From: Adrien Nortain <43404315+ZenikAdrien@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:31:31 +0100 Subject: [PATCH] Safecoding certs (#723) * :wrench: Fix cert modal --- hasura/metadata/tables.yaml | 1 + src/components/organisms/CertificationModal.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index f0448ed6..529852d7 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -606,6 +606,7 @@ - last_login - name - picture + - active filter: {} allow_aggregations: true update_permissions: diff --git a/src/components/organisms/CertificationModal.tsx b/src/components/organisms/CertificationModal.tsx index 5f6a6fce..31cc8243 100644 --- a/src/components/organisms/CertificationModal.tsx +++ b/src/components/organisms/CertificationModal.tsx @@ -32,11 +32,10 @@ const CertificationModal = ({ const [hasExpiryDate, setHasExpiryDate] = useState( editMode && !!userCertificationRef.to ); - const sortedCerts = certificationsRef - ? certificationsRef.sort((a, b) => - a.certBody + a.name > b.certBody + b.name ? 1 : -1 - ) - : []; + let sortedCerts = certificationsRef.map((x) => x); + sortedCerts.sort((a, b) => + a.certBody + a.name > b.certBody + b.name ? 1 : -1 + ); return (