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.
|
2022-11-09 23:15:31 +00:00
|
|
|
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') };
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|