open-vault/ui/app/adapters/server.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

20 lines
522 B
JavaScript

import ApplicationAdapter from './application';
const fetchUrl = '/v1/sys/storage/raft/configuration';
export default ApplicationAdapter.extend({
urlForFindAll() {
return fetchUrl;
},
urlForQuery() {
return fetchUrl;
},
urlForDeleteRecord() {
return '/v1/sys/storage/raft/remove-peer';
},
deleteRecord(store, type, snapshot) {
const server_id = snapshot.attr('nodeId');
const url = '/v1/sys/storage/raft/remove-peer';
return this.ajax(url, 'POST', { data: { server_id } });
},
});