peterlu
12 years agoChampion
custom user setting problem / issue
<#if !user.anonymous> profile.user.data = ${settings.name.get("profile.user.data")} <@liaAddScript> ;(function($) { $.post("/restapi/vc/users/self/profiles/name/user.data/set", {value: "my user data Two"}).done(function(data) { console.log(data); alert("done"); }).fail(function() { alert("error"); }); })(LITHIUM.jQuery); </@liaAddScript> </#if>
This code prints out
profile.user.data = my user data ONE
and when I tried to set it to "my user data Two", I got "error code 100 - An unexpected error has occured" in the response. I was logged in as admin, and I was testing it inside studio component editor.
I have also tried all these:
$.post("/restapi/vc/users/self/profiles/name/user.data/set", ...
$.post("/restapi/vc/users/self/profiles/name/profile.user.data/set", ...
$.post("/restapi/vc/users/self/settings/name/user.data/set", ...
$.post("/restapi/vc/users/self/settings/name/profile.user.data/set", ...
Also no luck.
BTW, lithium team helped us set up this:
[profile]
user.data :wcu string 0 64000
Thanks.