diff --git a/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js b/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js index e38d09c0b..44442f92c 100644 --- a/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js +++ b/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import UploadCertificate from "./UploadCertificate"; -import HttpService from '../services/HttpService'; +import HttpService from "../services/HttpService"; function PartnerCertificatesList() { @@ -9,11 +9,11 @@ function PartnerCertificatesList() { const navigate = useNavigate(); const [showPopup, setShowPopup] = useState(false); + const [selectedPartnerData, setSelectedPartnerData] = useState(null); const [certificatesData, setcertificatesData] = useState([]); const [errorMsg, setErrorMsg] = useState(""); const [dataLoaded, setDataLoaded] = useState(false); - const [selectedPartnerData, setSelectedPartnerData] = useState(null); - + const clickOnUpload = (partner) => { setShowPopup(!showPopup); setSelectedPartnerData(partner); @@ -32,7 +32,6 @@ function PartnerCertificatesList() { const fetchData = async () => { try { const response = await HttpService.get('/api/partners/getAllCertificateDetails'); - if (response != null) { const responseData = response.data; if (responseData.errors && responseData.errors.length > 0) { @@ -44,8 +43,8 @@ function PartnerCertificatesList() { setcertificatesData(resData); console.log('Response data:', resData); } - }else{ - setErrorMsg("Response is null"); + } else { + setErrorMsg("There is some error in fetching the certificates. Try again later!"); } setDataLoaded(true); } catch (err) { @@ -73,7 +72,7 @@ function PartnerCertificatesList() { }; return ( -
- {errorMsg} -
-+ {errorMsg} +
+moveToHome()} className="font-semibold text-blue-500 text-xs cursor-pointer"> - Home
+ )} +moveToHome()} className="font-semibold text-blue-500 text-xs cursor-pointer"> + Home
+