This commit is contained in:
@@ -899,17 +899,15 @@ function formErrorFromSaveResult(vm) {
|
||||
*
|
||||
*/
|
||||
let ret = {
|
||||
error: {
|
||||
code: "2200", //todo: maybe an alternate error code and message indicating a package of errors (envelope?)
|
||||
details: [],
|
||||
message: "ErrorAPI2200"
|
||||
}
|
||||
code: "2200", //todo: maybe an alternate error code and message indicating a package of errors (envelope?)
|
||||
details: [],
|
||||
message: "ErrorAPI2200"
|
||||
};
|
||||
vm.saveResult.errors.forEach(z => {
|
||||
z.error.details.forEach(x => {
|
||||
let target = errorTargetFromSaveResult(vm, z, x.target);
|
||||
if (target != null) {
|
||||
ret.error.details.push({
|
||||
ret.details.push({
|
||||
message: x.message,
|
||||
error: x.error,
|
||||
target: target
|
||||
@@ -918,10 +916,8 @@ function formErrorFromSaveResult(vm) {
|
||||
});
|
||||
});
|
||||
|
||||
console.log("source:", JSON.stringify(vm.saveResult));
|
||||
console.log("result: ", JSON.stringify(ret));
|
||||
|
||||
return ret.error;
|
||||
console.log(Object.assign({}, ret));
|
||||
return ret;
|
||||
|
||||
/*
|
||||
source: {"fatal":false,"errors":[{"error":{"code":"2200","details":[{"message":"SAVE TEST ERROR","target":"Notes","error":"2203"}],"message":"ErrorAPI2200"},"itemUid":0}]}
|
||||
|
||||
Reference in New Issue
Block a user