open-vault/ui/app/adapters/identity/entity-merge.js

18 lines
554 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
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;
2018-04-03 14:16:57 +00:00
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') };
});
},
});