summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/sdk/account.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/sdk/account.js')
-rw-r--r--StoneIsland/www/js/sdk/account.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/StoneIsland/www/js/sdk/account.js b/StoneIsland/www/js/sdk/account.js
index 3b48b0d9..5b3b9f1e 100644
--- a/StoneIsland/www/js/sdk/account.js
+++ b/StoneIsland/www/js/sdk/account.js
@@ -47,6 +47,38 @@ sdk.account = (function(){
})
}
+ account.update = function(opt){
+ return $.ajax({
+ method: "PUT",
+ url: sdk.path("Account.API/1.5", "users/" + auth.user_id + ".json"),
+ headers: {
+ "x-yoox-appname": auth.appname,
+ "x-yoox-account-token": auth.access_token,
+ },
+ data: JSON.stringify( opt.data ),
+ success: function(data){
+ opt.success(data)
+ },
+ error: opt.error,
+ })
+ }
+
+ account.update_mail_and_password = function(opt){
+ return $.ajax({
+ method: "PUT",
+ url: sdk.path("Account.API/1.5", "auth/" + auth.user_id + ".json"),
+ headers: {
+ "x-yoox-appname": auth.appname,
+ "x-yoox-account-token": auth.access_token,
+ },
+ data: JSON.stringify( opt.data ),
+ success: function(data){
+ opt.success(data)
+ },
+ error: opt.error,
+ })
+ }
+
return account
})()