Commit 50fd9306 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update appAPI

parent 5a6f39e6
......@@ -1145,5 +1145,32 @@ this.appAPI = {
resolve(null);
}
});
},
getPersonnelFiles: async function(){
return new Promise(async resolve => {
rest.synergyGet(`api/personnelFiles/tree?locale=${AS.OPTIONS.locale}`, resolve, err => {
console.log(`ERROR [ getPersonnelFiles ]: ${JSON.stringify(err)}`);
resolve(null);
});
});
},
copyToPersonalFile: 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/copyPrFolder`, {
method: 'POST',
headers: {"Authorization": auth, "Content-Type": "application/json; charset=UTF-8"},
body: JSON.stringify(body)
});
resolve(response.json());
} catch (err) {
console.log(`ERROR [ copyToPersonalFile ]: ${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