mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 20:04:16 +08:00
Route serialize
hook argument is the model, not params.
This commit is contained in:
parent
5e93d60e9b
commit
28731ea633
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user