open-vault/ui/app/adapters/pki.js
Chris Dituri 471f26a0e3 ui/app/adapters/pki.js: fix typo in assert() message (#5882)
Update the assertion to indicate, in order to override the PKI adapter
url() method, one should extend the PKI adapter; not the SSH adapter.
2018-12-03 16:14:59 -06:00

23 lines
693 B
JavaScript

import { assert } from '@ember/debug';
import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
namespace: 'v1',
url(/*role*/) {
assert('Override the `url` method to extend the PKI adapter', false);
},
createRecord(store, type, snapshot, requestType) {
const serializer = store.serializerFor(type.modelName);
const data = serializer.serialize(snapshot, requestType);
const role = snapshot.attr('role');
return this.ajax(this.url(role, snapshot), 'POST', { data }).then(response => {
response.id = snapshot.id;
response.modelName = type.modelName;
store.pushPayload(type.modelName, response);
});
},
});