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