open-vault/ui/app/adapters/pki/issuer.js
claire bontempo c5e9c15e49
UI: Remove prepended pki- to new engine files (#17875)
* append -old to non-engine pki models

* revert old file name

* remove -engine from all pki component, model, adapter and serializer files

* add md file explaining pki naming
2022-11-10 13:27:19 -08:00

28 lines
655 B
JavaScript

import ApplicationAdapter from '../application';
import { encodePath } from 'vault/utils/path-encoding-helpers';
export default class PkiIssuerAdapter extends ApplicationAdapter {
namespace = 'v1';
optionsForQuery(id) {
const data = {};
if (!id) {
data['list'] = true;
}
return { data };
}
urlForQuery(backend, id) {
let url = `${this.buildURL()}/${encodePath(backend)}/issuers`;
if (id) {
url = url + '/' + encodePath(id);
}
return url;
}
query(store, type, query) {
const { backend, id } = query;
return this.ajax(this.urlForQuery(backend, id), 'GET', this.optionsForQuery(id));
}
}