Commit c76f1c05 authored by Moises Sacal's avatar Moises Sacal
Browse files

added reducer for checking links for issue #27

parent ba3d887a
This diff is collapsed.
......@@ -90,9 +90,9 @@ export class LabarchivesListField extends FieldBase<any> {
}
checkLinks() {
//this.workspaces[index]['linkedState'] == 'check'; // Possible values: linked, another, link
this.workspaces.map((w, index) => {
this.labarchivesService.checkLink(this.rdmp, w['id'])
this.workspaces.reduce((promise, w, index) => {
return promise.then(() => {
return this.labarchivesService.checkLink(this.rdmp, w['id'])
.then((response) => {
if (!response.status) {
throw new Error('Error checking workspace');
......@@ -109,6 +109,7 @@ export class LabarchivesListField extends FieldBase<any> {
this.workspaces[index]['linkedState'] = 'problem';
});
});
}, Promise.resolve());
}
}
......
Supports Markdown
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