open-vault/ui/app/adapters/kmip/scope.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

27 lines
643 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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');
},
});