mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
parent
80cbef8cdb
commit
3bddb548a5
@ -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…
Reference in New Issue
Block a user