shorten editProfile
This commit is contained in:
parent
7735b6cfdb
commit
a5caad8e46
@ -458,17 +458,16 @@ Meteor.methods({
|
|||||||
// User Functions
|
// User Functions
|
||||||
'editProfile': function(change) {
|
'editProfile': function(change) {
|
||||||
var current = Meteor.user().profile;
|
var current = Meteor.user().profile;
|
||||||
current.school = change.school;
|
current = {
|
||||||
current.grade = change.grade;
|
"__proto__": current.__proto__,
|
||||||
current.classes = change.classes;
|
"school": change.school,
|
||||||
if (!current.classes) {
|
"grade": change.grade,
|
||||||
current.classes = [];
|
"classes": change.classes,
|
||||||
}
|
"description": change.description,
|
||||||
current.description = change.description;
|
"avatar": change.avatar,
|
||||||
current.avatar = change.avatar;
|
"banner": change.banner,
|
||||||
current.banner = change.banner;
|
"preferences": change.preferences
|
||||||
current.preferences = change.preferences;
|
};
|
||||||
|
|
||||||
if (current.description && current.description.length > 50) {
|
if (current.description && current.description.length > 50) {
|
||||||
current.description = current.description.slice(0, 50);
|
current.description = current.description.slice(0, 50);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user