Commit 4b152f7d authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174989 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 78a6e18b
...@@ -11,7 +11,8 @@ import { Item } from '../../ecm-model/product-model'; ...@@ -11,7 +11,8 @@ import { Item } from '../../ecm-model/product-model';
@Injectable() @Injectable()
export class EcmWishListService { export class EcmWishListService {
private wishListUrl = '/ecm/service/feeds/wishlist'; // URL to web service // private wishListUrl = '/ecm/service/feeds/L2D01/wishlist'; // URL to web service
private wishListUrl = '/ecm/service/feeds';
wishListItems: Item[]; wishListItems: Item[];
public itemCode; public itemCode;
...@@ -34,8 +35,9 @@ export class EcmWishListService { ...@@ -34,8 +35,9 @@ export class EcmWishListService {
console.log('hostUrl: inside wishlist service fetchWishlistItems['+ this.hostUrlService.hostUrl+this.wishListUrl+']'); console.log('hostUrl: inside wishlist service fetchWishlistItems['+ this.hostUrlService.hostUrl+this.wishListUrl+']');
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.get( this.hostUrlService.hostUrl+this.wishListUrl, options ) return this.http.get( this.hostUrlService.hostUrl+this.wishListUrl + '/' + siteCode + '/wishlist' , options )
.map( (res) => this.extractData(res) ) .map( (res) => this.extractData(res) )
.catch( this.handleError ); .catch( this.handleError );
} }
...@@ -43,16 +45,18 @@ export class EcmWishListService { ...@@ -43,16 +45,18 @@ export class EcmWishListService {
addToWishlist(itemCode) { addToWishlist(itemCode) {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.post( this.hostUrlService.hostUrl+this.wishListUrl+'/'+itemCode , options) return this.http.post( this.hostUrlService.hostUrl+this.wishListUrl + '/' + siteCode + '/wishlist' +'/' + itemCode , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
deleteWishlistItem(itemCode) { deleteWishlistItem(itemCode) {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.delete( this.hostUrlService.hostUrl+this.wishListUrl+'/'+itemCode, options) return this.http.delete( this.hostUrlService.hostUrl+this.wishListUrl + '/' + siteCode + '/wishlist' + '/' + itemCode, options)
.map( (res) => this.extractData(res) ); .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