Commit 4ad993a1 authored by Sergey Antonovich's avatar Sergey Antonovich 🇯🇵

Update jSynergy.js

parent dbe0319e
......@@ -1291,7 +1291,7 @@ function __classSynergy() {
let modifiedComponentsList = __CLIENT__.getModifiedFormdata();
if (modifiedComponentsList.length) {
let config = {
let save = __CLIENT__.api('asforms/data/merge', {
type: 'POST',
headers: {
'Content-Type': 'application/json'
......@@ -1300,13 +1300,20 @@ function __classSynergy() {
uuid: __CLIENT__.getDataUUID(),
data: modifiedComponentsList
})
};
let save = __CLIENT__.api('asforms/data/merge', config);
});
if (save && +save.errorCode === 0) {
console.info('\n\n');
console.info(__LIBRARY_PREFIX__ + '' + JSON.stringify(modifiedComponentsList));
modifiedComponentsList.forEach(function(modifyComponent) {
const compIndex = __CLIENT__.getDefaultFormData().findIndex(function(component) {
return component.id === modifyComponent.id
})
if(compIndex !== -1) {
__CLIENT__.getDefaultFormData()[compIndex] = Object.assign({}, modifyComponent);
}
});
console.info('\n\n' + __LIBRARY_PREFIX__ + '' + JSON.stringify(modifiedComponentsList));
console.info(
__LIBRARY_PREFIX__ + 'Data changed successfully!' +
'\nNumber of components changed: ' + modifiedComponentsList.length +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment