vault/ui/app/adapters/identity/entity-merge.js
Hamid Ghaf e55c18ed12
adding copyright header (#19555)
* adding copyright header

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

23 lines
632 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import IdentityAdapter from './base';
export default IdentityAdapter.extend({
buildURL() {
// first arg is modelName which we're hardcoding in the call to _super.
const [, ...args] = arguments;
return this._super('identity/entity/merge', ...args);
},
createRecord(store, type, snapshot) {
return this._super(...arguments).then(() => {
// return the `to` id here so we can redirect to it on success
// (and because ember _loves_ 204s for createRecord)
return { id: snapshot.attr('toEntityId') };
});
},
});