Skip to content

Commit

Permalink
hotfix(http): check for 200 in patch request (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
emoralesb05 authored and kyleledbetter committed Oct 12, 2016
1 parent 7b7b676 commit 5a29149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platform/http/http-rest.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export abstract class RESTService<T> {
let requestOptions: RequestOptionsArgs = this.buildRequestOptions();
let request: Observable<Response> = this.http.patch(this.buildUrl(id), obj, requestOptions);
return request.map<T>((res: Response) => {
return <T>this.transform(res);
if (res.status === 200) {
return this.transform(res);
} else {
return res;
}
}).catch<any>((error: Response) => {
return new Observable<any>((subscriber: Subscriber<any>) => {
try {
Expand Down

0 comments on commit 5a29149

Please sign in to comment.