Fixed delete mix up

This commit is contained in:
Cyrus 2023-11-28 08:01:30 -05:00
parent 0a215d7973
commit 995d69cc8f

View File

@ -375,7 +375,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
try {
UUID uuid = UUID.fromString(id);
Certificate certificate = getCertificateById(certificateType, uuid);
Certificate certificate = certificateRepository.getCertificate(uuid);
if (certificate == null) {
// Use the term "record" here to avoid user confusion b/t cert and cred
@ -749,29 +749,6 @@ public class CertificatePageController extends PageController<NoPageParams> {
return associatedCertificates;
}
private Certificate getCertificateById(final String certificateType, final UUID uuid) {
switch (certificateType) {
case PLATFORMCREDENTIAL:
if (platformCertificateRepository.existsById(uuid)) {
return platformCertificateRepository.getReferenceById(uuid);
}
case ENDORSEMENTCREDENTIAL:
if (endorsementCredentialRepository.existsById(uuid)) {
return endorsementCredentialRepository.getReferenceById(uuid);
}
case ISSUEDCERTIFICATES:
if (issuedCertificateRepository.existsById(uuid)) {
return issuedCertificateRepository.getReferenceById(uuid);
}
case TRUSTCHAIN:
if (caCredentialRepository.existsById(uuid)) {
return caCredentialRepository.getReferenceById(uuid);
}
default:
return null;
}
}
/**
* Parses an uploaded file into a certificate and populates the given model
* with error messages if parsing fails.