mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
1f834521b6
closes #6095 - implements custom user adapter for the `/team/:slug/` route - abstracts slug-url behavior into a mixin (used in /settings/tags/ as well) - adds unit tests for both tag and user adapters
16 lines
370 B
JavaScript
16 lines
370 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {isBlank} = Ember;
|
|
|
|
export default Ember.Mixin.create({
|
|
buildURL: function (_modelName, _id, _snapshot, _requestType, query) {
|
|
let url = this._super(...arguments);
|
|
|
|
if (query && !isBlank(query.slug)) {
|
|
url += `slug/${query.slug}/`;
|
|
delete query.slug;
|
|
}
|
|
|
|
return url;
|
|
}
|
|
});
|