open-vault/ui/app/adapters/kmip/scope.js
Jordan Reimer 52fe56ec87
Eslint prefer-const (#17864)
* adds prefer-const to eslint config and runs fixer

* reverts unintended change
2022-11-09 15:15:31 -08:00

22 lines
565 B
JavaScript

import BaseAdapter from './base';
export default BaseAdapter.extend({
createRecord(store, type, snapshot) {
const name = snapshot.attr('name');
return this.ajax(this._url(type.modelName, { backend: snapshot.record.backend }, name), 'POST').then(
() => {
return {
id: name,
name,
};
}
);
},
deleteRecord(store, type, snapshot) {
let url = this._url(type.modelName, { backend: snapshot.record.backend }, snapshot.id);
url = `${url}?force=true`;
return this.ajax(url, 'DELETE');
},
});