Commit 51c3cc5d authored by prumde's avatar prumde

Updated ecm-wish-list.service.ts


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174526 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2edfd67f
......@@ -5,17 +5,18 @@ import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import { Store } from '@ngrx/store';
import { AppState } from '../../ecm-store/reducers';
import { HostUrlService } from '../../host-url.service';
import { Item } from '../../ecm-model/product-model';
@Injectable()
export class EcmWishListService {
private wishListUrl = '/ecm/service/feeds/wishlist'; // URL to web service
wishListItems: Item[];
public itemCode;
constructor( private http: Http, private store: Store<AppState> ) { }
constructor( private http: Http, private store: Store<AppState>,public hostUrlService : HostUrlService ) { }
setWishlistItems() {
this.fetchWishlistItems().subscribe(
......@@ -30,10 +31,11 @@ export class EcmWishListService {
}
fetchWishlistItems(): Observable<Item[]> {
console.log('hostUrl: inside wishlist service fetchWishlistItems['+ this.hostUrlService.hostUrl+this.wishListUrl+']');
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
return this.http.get( this.wishListUrl, options )
return this.http.get( this.hostUrlService.hostUrl+this.wishListUrl, options )
.map( (res) => this.extractData(res) )
.catch( this.handleError );
}
......@@ -42,7 +44,7 @@ export class EcmWishListService {
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
return this.http.post( '/ecm/service/feeds/wishlist/'+itemCode , options)
return this.http.post( this.hostUrlService.hostUrl+'/ecm/service/feeds/wishlist/'+itemCode , options)
.map( (res) => this.extractData(res) );
}
......@@ -50,7 +52,7 @@ export class EcmWishListService {
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
return this.http.delete( '/ecm/service/feeds/wishlist/'+itemCode, options)
return this.http.delete( this.hostUrlService.hostUrl+'/ecm/service/feeds/wishlist/'+itemCode, options)
.map( (res) => this.extractData(res) );
}
......
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