Skip to content

Commit

Permalink
MOSIP-36321, MOSIP-36331: Refactored the get certificate functions.
Browse files Browse the repository at this point in the history
Signed-off-by: Anil_Kumar_Majji <[email protected]>
  • Loading branch information
Anil-kumar-Majji committed Oct 22, 2024
1 parent cbd1ca0 commit ec2a37a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function ViewPartnerDetails() {

useEffect(() => {
const selectedPartnerId = localStorage.getItem('selectedPartnerId');
console.log(selectedPartnerId);
if (!selectedPartnerId) {
setUnexpectedError(true);
return;
Expand Down Expand Up @@ -99,7 +98,7 @@ function ViewPartnerDetails() {
setErrorMsg("");
setSuccessMsg("");
try {
const responseData = await getTheCertificate(HttpService, partnerId, setErrorCode, setErrorMsg, t);
const responseData = await getTheCertificate(HttpService, partnerId, setErrorCode, setErrorMsg);
if (responseData) {
const resData = responseData.response;
console.log('Response data:', resData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function PartnerCertificatesList() {
setErrorMsg("");
setSuccessMsg("");
try {
const responseData = await getTheCertificate(HttpService, partnerId, setErrorCode, setErrorMsg, t);
const responseData = await getTheCertificate(HttpService, partnerId, setErrorCode, setErrorMsg);
if (responseData) {
const resData = responseData.response;
console.log('Response data:', resData);
Expand Down
4 changes: 2 additions & 2 deletions pmp-reactjs-ui/src/utils/AppUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ export const getTheCertificate = async (HttpService, partnerId, setErrorCode, se
handleServiceErrors(responseData, setErrorCode, setErrorMsg);
}
} else {
return response;
return null;
}

} catch (error) {
console.error('Error fetching certificate:', error);
return null;
}
};

Expand Down

0 comments on commit ec2a37a

Please sign in to comment.