2016-06-30 13:21:47 +03:00
|
|
|
import Mixin from 'ember-metal/mixin';
|
|
|
|
import {isBlank} from 'ember-utils';
|
2015-11-23 16:48:08 +03:00
|
|
|
|
2016-06-11 19:52:36 +03:00
|
|
|
export default Mixin.create({
|
2015-10-28 14:36:45 +03:00
|
|
|
buildURL(_modelName, _id, _snapshot, _requestType, query) {
|
2015-11-23 16:48:08 +03:00
|
|
|
let url = this._super(...arguments);
|
|
|
|
|
|
|
|
if (query && !isBlank(query.slug)) {
|
|
|
|
url += `slug/${query.slug}/`;
|
|
|
|
delete query.slug;
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
});
|