Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(bug): fix getWorkItemTypesById get to pass to a map instead of a …
Browse files Browse the repository at this point in the history
…Promise that was not passing data to the 'then'
  • Loading branch information
joshuawilson committed Mar 4, 2017
1 parent a3f38ba commit 73c0f95
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/work-item/work-item.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,14 @@ export class WorkItemService {
return Promise.resolve(workItemType);
} else {
let workItemTypeUrl = this.baseApiUrl + 'workitemtypes/' + id;
this.http.get(workItemTypeUrl)
.toPromise()
.then((response) => {
return this.http.get(workItemTypeUrl)
.map((response) => {
workItemType = response.json().data as WorkItemType;
this.workItemTypes.push(workItemType);
return Promise.resolve(workItemType);
});
return workItemType;
})
.toPromise();
}
this.workItemTypeUrl = this.baseApiUrl + 'workitemtypes/' + id;
} else {
return Promise.resolve<WorkItemType>( {} as WorkItemType );
}
Expand Down

0 comments on commit 73c0f95

Please sign in to comment.