mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
parent
80cbef8cdb
commit
3bddb548a5
1 changed files with 8 additions and 1 deletions
|
@ -1,11 +1,18 @@
|
|||
var SettingsUserRoute = Ember.Route.extend({
|
||||
model: function (params) {
|
||||
var self = this;
|
||||
// TODO: Make custom user adapter that uses /api/users/:slug endpoint
|
||||
// return this.store.find('user', { slug: params.slug });
|
||||
|
||||
// Instead, get all the users and then find by slug
|
||||
return this.store.find('user').then(function (result) {
|
||||
return result.findBy('slug', params.slug);
|
||||
var user = result.findBy('slug', params.slug);
|
||||
|
||||
if (!user) {
|
||||
return self.transitionTo('error404', 'settings/users/' + params.slug);
|
||||
}
|
||||
|
||||
return user;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue