Open WojakGra opened 2 years ago
Hi @WojakGra ,
I've confirmed the issue, we'll fix it in the upcoming bugfix update.
Meanwhile, please try initializing the dataprocessor with a function, like this:
scheduler.createDataProcessor(function(entity, action, data){
switch(action) {
case "create":
console.log(data);
return new scheduler.Promise(function (resolve, reject) {
$.post(
"api.php",
{ action: "test", data: data },
function (result) {
return resolve({
action: result.action,
tid: result.tid,
data: result.task,
});
},
"json"
);
});
break;
case "update":
console.log(data);
console.log(id);
return new scheduler.Promise(function (resolve, reject) {
$.post(
"api.php",
{ action: "test", data: data },
function (result) {
return resolve({ action: result.action });
},
"json"
);
});
break;
case "delete":
console.log(id);
return new scheduler.Promise(function (resolve, reject) {
$.post(
"api.php",
{ action: "test", data: id },
function (result) {
return resolve({ action: result.action });
},
"json"
);
});
break;
}
});
Then it should work correctly.
Upper code not working as intentended because is shows a console error