상황 내가 웹 응용 프로그램 내 백엔드 후 Parse.com을 사용하고Parse.com Cloud 코드 afterSave() 오류 : "캐치되지 않았습니다. 저장되지 않은 새 개체에 대한 포인터가있는 개체를 저장하려고했습니다."
. 내가 겪고있는 문제는 클라우드 코드과 관련됩니다.
사용자가 자신의 프로필을 완료 한 후
는, 나는 afterSave() 함수를 호출 할 데이터 세트 MY_TABLE에서 업데이트 몇 가지 필드.업데이트되는 필드 (variable01, variable02 및 variable03)는 입력 param01 및 param02로 MY_FUNCTION 함수를 통해 검색됩니다.
오류
내가받을 다음과 같은 오류, 내가 고칠 수 없습니다. "catch되지 않은 새로운 저장되지 않은 개체에 대한 포인터와 객체를 저장하려고"가
코드
Parse.Cloud.afterSave("PROFILE_COMPLETE", function(request) {
// Use Master Key
Parse.Cloud.useMasterKey();
// Identify Parameters in Request
var param01 = request.user.get('param01');
var param02 = request.user.get('param02');
// Print Parameters to Console
console.log("Parameter 01 (" + param01 + ") successfully identified");
console.log("Parameter 02 (" + param02 + ") successfully identified");
// Identify Variables by Calling MY_FUNCTION()
Parse.Cloud.run('MY_FUNCTION', {param01: param01, param02: param02}, {
success: function(results) {
// Print Results
console.log("Function MY_FUNCTION() returned successful response");
console.log(results);
// Print Result Variables
console.log("Identified variable01 = " + results.variable01);
console.log("Identified variable02 = " + results.variable02);
console.log("Identified variable03 = " + results.variable03);
// Do I need to extend MY_TABLE or something else here???
// I am doing the update and save wrong...
// Update 'Complete' Data
request.object.set("variable01", results.variable01);
request.object.set("variable02", results.variable02);
request.object.set("variable03", results.variable03);
// Save Variables to 'MY_TABLE'
request.object.save(null, {
success: function(results) {
console.log("Variables successfully updated in MY_TABLE dataset");
console.log(results);
},
error: function(error) {
console.log("Error when saving variables in MY_TABLE dataset");
console.log("Error " + error.code + ": " + error.message);
}
})
},
error: function(error) {
console.log("There was an error when running function MY_FUNCTION()");
console.log(error);
}
});
});
을 .success'. – eth3lbert
** Parse.Cloud.afterSave() **에는 함수 구문의 일부로 호출되는 "응답"이 없습니다. https://parse.com/docs/cloud_code_guide#functions-aftersave – Jesse
아, 맞습니다. – eth3lbert