我试图使用Syncano用户管理系统实现用户注册我的应用程序。我可以使用下面的JS库代码成功地创建一个新用户:Syncano用户管理配置文件更新错误
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);
});
当我在第一个的.then()语句中进行第二个API调用,我得到这个错误:
"api.syncano.io/v1/instances/INSTANCE/classes/user_profile/objects/26/:1 PATCH https://api.syncano.io/v1/instances/INSTANCE/classes/user_profile/objects/26/ 404 (NOT FOUND) user.service.js:77 Error: {"detail":"Not found"}"
任何想法?
看着这个。我没有得到404,但我确实得到了一个不同的错误。我可能需要重做我的例子。 –