Files
vault/ui/lib/pki/addon/routes/certificates/index.js
Jordan Reimer 9d46671659 PKI Certificate Details (#18737)
* adds pki certificate details page component

* adds tests for pki base adapter

* adds more comments

* updates remaining pki/certificate model references to pki/certificate/base
2023-01-18 00:52:47 +00:00

29 lines
736 B
JavaScript

import PkiOverviewRoute from '../overview';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default class PkiCertificatesIndexRoute extends PkiOverviewRoute {
@service store;
@service secretMountPath;
async fetchCertificates() {
try {
return await this.store.query('pki/certificate/base', { backend: this.secretMountPath.currentPath });
} catch (e) {
if (e.httpStatus === 404) {
return { parentModel: this.modelFor('certificates') };
} else {
throw e;
}
}
}
model() {
return hash({
hasConfig: this.hasConfig(),
certificates: this.fetchCertificates(),
parentModel: this.modelFor('certificates'),
});
}
}