Commit 5a6f39e6 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update appAPI

parent e2607df9
......@@ -1109,5 +1109,41 @@ this.appAPI = {
resolve(null);
}
});
},
saveDocument: async function(body) {
return new Promise(async resolve => {
try {
const {login, password} = Cons.creds;
const auth = "Basic " + btoa(unescape(encodeURIComponent(`${login}:${password}`)));
const response = await fetch(`../Synergy/rest/api/docflow/doc/chancellery/save`, {
method: 'POST',
headers: {"Authorization": auth, "Content-Type": "application/json; charset=UTF-8"},
body: JSON.stringify(body)
});
resolve(response.json());
} catch (err) {
console.log(`ERROR [ saveDocument ]: ${err.message}`);
resolve(null);
}
});
},
markDefective: async function(body) {
return new Promise(async resolve => {
try {
const {login, password} = Cons.creds;
const auth = "Basic " + btoa(unescape(encodeURIComponent(`${login}:${password}`)));
const response = await fetch(`../Synergy/rest/api/docflow/doc/markDefective`, {
method: 'POST',
headers: {"Authorization": auth, "Content-Type": "application/json; charset=UTF-8"},
body: JSON.stringify(body)
});
resolve(response.json());
} catch (err) {
console.log(`ERROR [ markDefective ]: ${err.message}`);
resolve(null);
}
});
}
}
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