同步用户管理配置文件更新错误
Syncano User Management Profile Update Error
我尝试使用Syncano用户管理系统为我的应用程序实现用户注册。我能够使用以下JS库代码成功创建一个新用户:
var sync = new Syncano({ apiKey: 'API_KEY', instance: 'INSTANCE' });
sync.user().add(signUp).then(function(res){
console.log(res);
}).catch(function(err) {
console.log(err);
});
然后我尝试通过以下代码向我的用户添加配置文件字段:https://www.syncano.io/user-management-for-your-apps/#adding-fields
var sync = new Syncano({ apiKey: 'API_KEY', instance: 'INSTANCE' });
sync.user().add(signUp).then(function(res){
var instance = new Syncano({
apiKey: API_KEY,
instance: INSTANCE_NAME,
userKey: res.user_key
});
instance.class('user_profile').dataobject(res.id).update({firstName: 'First', lastName: 'Last'});
}).catch(function(err) {
console.log(err);
});
当我在第一个API的.then()语句中进行第二个API调用时,我得到了这个错误:
" api.syncano.io/v1/实例//类/user_profile/对象/26/实例:1补丁https://api.syncano.io/v1/instances/INSTANCE/classes/user_profile/objects/26/404 (NOT FOUND) user.service.js:77错误:{"detail":" NOT FOUND "}"
任何想法?
看起来示例代码有问题(遗憾的是我写的)。
创建用户后返回的对象中,user
对象有id
字段,user_profile
对象有profile.id
字段。
行应该是这样的
instance.class('user_profile').dataobject(res.profile.id).update({firstName: 'First', lastName: 'Last'});
在当前系统中还有另一个警告,我也会注意到-您必须首先将user_profile
类的other permissions
设置为read
。
最终将在平台中更改为默认为read
。
希望这对你有帮助!
相关文章:
- Ajax更新面板随机错误'PRM_MissingPanel'
- 任何人都知道IE7设置或更新/补丁,它可以防止IE因为jquery错误而无法加载页面
- Node.js错误“;ReferenceError:全局未定义“;在从0.10.2更新到0.12.2之后
- d3在数据更新时错误地附加了dom元素
- D3-更新时元素数量正确,但值错误
- 使用odata 4的jaydata 1.5和保存/更新数据时的错误
- Wordpress更新后出现插件错误
- 更新带有Javascript函数错误的变量
- 将节点.js更新为 0.12 标头错误
- Web 驱动程序管理器更新错误:EACCES,权限被拒绝
- 谷歌图表错误'不是数组'关于Ajax更新
- 更新到WP 4.5后,Wordpress中出现Visual Composer错误
- 更新时React Redux调度导致递归错误
- 更新:用户错误-TYPO!!grunt contrib咖啡错误查找文件&写入目的地
- React,Flux,React路由器调度错误-可能的批更新解决方案
- 如何使用错误消息或成功消息动态更新我的跨度
- MongoDB For Loop更新错误的用户
- nvd3多条形图状态在图例切换时更新错误
- 同步用户管理配置文件更新错误
- 谷歌任务更新错误