Commit e2607df9 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update appAPI

parent 5d86ded8
......@@ -1043,6 +1043,23 @@ this.appAPI = {
});
},
documentFilterSave: async function(body){
return new Promise(async resolve => {
try {
const {login, password} = Cons.creds;
const url = `../Synergy/rest/api/docflow/filters/save`;
const headers = new Headers();
headers.append("Authorization", "Basic " + btoa(unescape(encodeURIComponent(`${login}:${password}`))));
headers.append("Content-Type", "application/json; charset=UTF-8");
const response = await fetch(url, {method: 'POST', headers, body: JSON.stringify(body)});
resolve(response.json());
} catch (err) {
console.log(`ERROR [ documentFilterSave ]: ${err.message}`);
resolve(null);
}
});
},
documentFilterDelete: async function(filterID){
return new Promise(async resolve => {
try {
......@@ -1075,5 +1092,22 @@ this.appAPI = {
resolve(null);
}
});
},
documentMarkAsRead: async function(params){
return new Promise(async resolve => {
try {
const {login, password} = Cons.creds;
const url = `../Synergy/rest/api/documents/markAsRead?locale=${AS.OPTIONS.locale}${params ? '&'+params : ''}`;
const headers = new Headers();
headers.append("Authorization", "Basic " + btoa(unescape(encodeURIComponent(`${login}:${password}`))));
headers.append("Content-Type", "application/json; charset=UTF-8");
const response = await fetch(url, {method: 'POST', headers});
resolve(response.json());
} catch (err) {
console.log(`ERROR [ documentMarkAsRead ]: ${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