Skip to content

Commit

Permalink
fix(Workunit): Simplify response handling
Browse files Browse the repository at this point in the history
UI should be responsible for interpreting the information.

Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
  • Loading branch information
GordonSmith committed May 15, 2019
1 parent 82c18c0 commit efbd9e1
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/comms/src/ecl/workunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,19 +780,12 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
IncludeResultsViewNames: includeResults,
SuppressResultSchemas: false
}).then((response) => {
if (response.Workunit.ResourceURLCount) {
response.Workunit.ResourceURLCount = response.Workunit.ResourceURLCount - 1;
}
if (response.Workunit.ResourceURLs && response.Workunit.ResourceURLs.URL) {
response.Workunit.ResourceURLs.URL = response.Workunit.ResourceURLs.URL.filter((_, idx) => {
return idx > 0;
});
}
this.set(response.Workunit);
this.set({
ResultViews: includeResults ? response.ResultViews : [],
HelpersCount: response.Workunit.Helpers && response.Workunit.Helpers.ECLHelpFile ? response.Workunit.Helpers.ECLHelpFile.length : 0
} as IWorkunitState);
if (includeResults) {
this.set({
ResultViews: response.ResultViews
} as IWorkunitState);
}
return response;
}).catch((e: ESPExceptions) => {
// deleted ---
Expand Down

0 comments on commit efbd9e1

Please sign in to comment.