diff --git a/public/templates/accountedit.tpl b/public/templates/accountedit.tpl index 63f393e5db..9b931bfe16 100644 --- a/public/templates/accountedit.tpl +++ b/public/templates/accountedit.tpl @@ -76,7 +76,7 @@ $(document).ready(function(){ $('#submitBtn').on('click',function(){ - alert('click'); + var userData = { uid:$('#inputUID').val(), email:$('#inputEmail').val(), @@ -89,7 +89,7 @@ $.post('/edituser', userData, function(data) { - alert('fail'); + } ); diff --git a/src/user.js b/src/user.js index 09d87214f7..74acb2a48e 100644 --- a/src/user.js +++ b/src/user.js @@ -70,10 +70,15 @@ var config = require('../config.js'), }); } - User.updateUserFields = function(uid, data) { + User.updateProfile = function(uid, data) { - for(var key in data) { - User.setUserField(uid, key, data[key]); + var fields = ['email', 'fullname', 'website', 'location', 'birthday']; + var key = ''; + + for(var i=0,ii=fields.length; i