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) {
|
||||
|
||||
let alfrescoClient = this.getAlfrescoClient();
|
||||
return new Promise(function (resolve, reject) {
|
||||
let apiInstance = new AlfrescoApi.NodesApi(alfrescoClient);
|
||||
let nodeId = '-root-';
|
||||
let opts = {
|
||||
relativePath: folder,
|
||||
include: ['path']
|
||||
};
|
||||
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);
|
||||
});
|
||||
let apiInstance = new AlfrescoApi.NodesApi(alfrescoClient);
|
||||
let nodeId = '-root-';
|
||||
let opts = {
|
||||
relativePath: folder,
|
||||
include: ['path']
|
||||
};
|
||||
return apiInstance.getNodeChildren(nodeId, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user