mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Remove promises conversion form superagent callback in documentlist GET
Fixes #71
This commit is contained in:
@@ -68,26 +68,14 @@ export class AlfrescoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getNodesPromise(folder: string) {
|
private getNodesPromise(folder: string) {
|
||||||
|
|
||||||
let alfrescoClient = this.getAlfrescoClient();
|
let alfrescoClient = this.getAlfrescoClient();
|
||||||
return new Promise(function (resolve, reject) {
|
let apiInstance = new AlfrescoApi.NodesApi(alfrescoClient);
|
||||||
let apiInstance = new AlfrescoApi.NodesApi(alfrescoClient);
|
let nodeId = '-root-';
|
||||||
let nodeId = '-root-';
|
let opts = {
|
||||||
let opts = {
|
relativePath: folder,
|
||||||
relativePath: folder,
|
include: ['path']
|
||||||
include: ['path']
|
};
|
||||||
};
|
return apiInstance.getNodeChildren(nodeId, opts);
|
||||||
let callback = function (error, data /*, response*/) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
reject(error);
|
|
||||||
} else {
|
|
||||||
console.log('API returned data', data);
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.getNodeChildren(nodeId, opts, callback);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user