Commit 7dba76a5 authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174990 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4b152f7d
...@@ -14,8 +14,9 @@ import { HostUrlService } from '../host-url.service'; ...@@ -14,8 +14,9 @@ import { HostUrlService } from '../host-url.service';
@Injectable() @Injectable()
export class UserAddressService { export class UserAddressService {
private userActionUrl = '/ecm/service/feeds'; // private userActionUrl = '/ecm/service/feeds/L2D01';
public userAddress; private userActionUrl = '/ecm/service/feeds';
public userAddress;
constructor(private http: Http, private store: Store<AppState>, private addressActions: AdressAction, public hostUrlService : HostUrlService) { } constructor(private http: Http, private store: Store<AppState>, private addressActions: AdressAction, public hostUrlService : HostUrlService) { }
...@@ -23,8 +24,9 @@ export class UserAddressService { ...@@ -23,8 +24,9 @@ export class UserAddressService {
console.log( "fetchUserAddress Called" ); console.log( "fetchUserAddress Called" );
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.userActionUrl + "/addresses", options )
return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode + "/addresses", options )
.map( (res) => this.extractData(res) ) .map( (res) => this.extractData(res) )
.catch(this.handleError); .catch(this.handleError);
} }
...@@ -35,8 +37,9 @@ export class UserAddressService { ...@@ -35,8 +37,9 @@ export class UserAddressService {
console.log(JSON.stringify(userAdress)); console.log(JSON.stringify(userAdress));
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.userActionUrl +'/address', JSON.stringify(userAdress) , options) return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode +'/address', JSON.stringify(userAdress) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
...@@ -45,15 +48,17 @@ export class UserAddressService { ...@@ -45,15 +48,17 @@ export class UserAddressService {
console.log(JSON.stringify(userAdress)); console.log(JSON.stringify(userAdress));
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.userActionUrl +'/address', JSON.stringify(userAdress) , options) return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode +'/address', JSON.stringify(userAdress) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
deleteUserAddress( userAdress ) { deleteUserAddress( userAdress ) {
console.log( "deleteCartItem Called" ); console.log( "deleteCartItem Called" );
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.delete(this.hostUrlService.hostUrl+ this.userActionUrl + '/address/' + userAdress.lineNo, {}) return this.http.delete(this.hostUrlService.hostUrl+ this.userActionUrl + '/' + siteCode + '/address/' + userAdress.lineNo, {})
.map(res => res.json()); .map(res => res.json());
} }
......
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