Route serialize hook argument is the model, not params.

This commit is contained in:
Vikhyat Korrapati 2014-03-19 12:02:27 +05:30
parent 5e93d60e9b
commit 28731ea633
2 changed files with 5 additions and 5 deletions

View File

@ -8,8 +8,8 @@
**/ **/
Discourse.AdminUserRoute = Discourse.Route.extend({ Discourse.AdminUserRoute = Discourse.Route.extend({
serialize: function(params) { serialize: function(model) {
return { username: Em.get(params, 'username').toLowerCase() }; return { username: model.get('username').toLowerCase() };
}, },
model: function(params) { model: function(params) {

View File

@ -39,9 +39,9 @@ Discourse.UserRoute = Discourse.Route.extend({
return this.modelFor('user').findDetails(); return this.modelFor('user').findDetails();
}, },
serialize: function(params) { serialize: function(model) {
if (!params) return {}; if (!model) return {};
return { username: Em.get(params, 'username').toLowerCase() }; return { username: model.get('username').toLowerCase() };
}, },
setupController: function(controller, user) { setupController: function(controller, user) {