Commit 77fa97f3 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

appAPI - добавлены дополнительные методы

parent 3a4a8f90
......@@ -317,6 +317,15 @@ this.appAPI = {
});
},
getDocumentAttachments: async function(documentID){
return new Promise(resolve => {
rest.synergyGet(`api/docflow/doc/attachments?documentID=${documentID}&locale=${AS.OPTIONS.locale}`, resolve, err => {
console.log(`ERROR [ getAttachments ]: ${JSON.stringify(err)}`);
resolve(null);
});
});
},
getWorkActions: async function(workID) {
return new Promise(async resolve => {
rest.synergyGet(`api/workflow/work_actions?workID=${workID}&locale=${AS.OPTIONS.locale}`, resolve, err => {
......@@ -337,6 +346,17 @@ this.appAPI = {
});
},
addFileToDocument: async function(documentID, fileName, filePath, path) {
return new Promise(resolve => {
rest.synergyPost(`api/docflow/doc/attachment/create?locale=${AS.OPTIONS.locale}`,
{documentID, fileName, filePath, path},
"application/x-www-form-urlencoded; charset=UTF-8",
resolve,
resolve
);
});
},
getFile: async function(identifier, type = 'blob') {
return new Promise(async resolve => {
try {
......@@ -639,6 +659,15 @@ this.appAPI = {
});
},
setChildDocuments: async function(documentID, childDocuments = []) {
return new Promise(async resolve => {
AS.FORMS.ApiUtils.simpleAsyncPost(`rest/api/docflow/doc/set_child_documents?documentID=${documentID}`, resolve, null, JSON.stringify(childDocuments), "application/json", err => {
console.log(`ERROR [ setChildDocuments ]: ${JSON.stringify(err)}`);
resolve(null);
});
});
},
getCollationInfo: async function(registry_code, collated_registry_code) {
return new Promise(async resolve => {
rest.synergyGet(`api/registry/collation_info?registry_code=${registry_code}&collated_registry_code=${collated_registry_code}`, resolve, err => {
......
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