mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-08 03:44:31 +00:00
Fixed delete mix up
This commit is contained in:
parent
0a215d7973
commit
995d69cc8f
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user