Ghost/ghost/admin/app/mixins/slug-url.js
Austin Burdine cf36851265 deps: grunt-jscs,ember-suave@3.0.0
replaces #41, #60
- update ember-suave and grunt-jscs to 3.0
- standardize Ember global de-structuring rules across app & tests
2016-06-11 13:39:31 -06:00

17 lines
360 B
JavaScript

import Ember from 'ember';
const {isBlank, Mixin} = Ember;
export default Mixin.create({
buildURL(_modelName, _id, _snapshot, _requestType, query) {
let url = this._super(...arguments);
if (query && !isBlank(query.slug)) {
url += `slug/${query.slug}/`;
delete query.slug;
}
return url;
}
});