Commit fa66811e authored by pborate's avatar pborate

Updated ecm-checkout.component.ts and ecm-checkout.service.ts

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@176790 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c33e1a24
......@@ -40,7 +40,8 @@ import { EcmCartService } from '../ecm-cart/ecm-cart.service';
})
export class EcmCheckoutComponent implements OnInit ,DoCheck {
dataSource = '/ibase/ecm/service/customers/'
siteCode = localStorage.getItem('SITE_CODE');
dataSource = '/ibase/ecm/service/'+this.siteCode+'/customers/'
@ViewChild('userForm') currentForm: NgForm;
@Input() unAuthorized: boolean = false;
......@@ -279,16 +280,6 @@ export class EcmCheckoutComponent implements OnInit ,DoCheck {
item => {
item.itemCode;
console.log('selectAddress cartItems:', item.itemCode);
// this.checkoutService.getSalesRate(item.itemCode).subscribe(
// result => {
// console.log( 'comp results[' + result.sales + ']status' );
//
// },
// error => {
// let errorMessage = <any>error;
// console.log( 'comp errorMessage[' + errorMessage + ']' );
// }
// );
}
);
......
......@@ -12,16 +12,18 @@ export class EcmCheckoutService {
constructor (private http: Http,public hostUrlService : HostUrlService ) {}
singleItem: ItemDetail;
private SERVICE_URL = '/ecm/service/SalesRate'; // URL to web service
private SERVICE_URL = '/ecm/service'; // URL to web service
private userActionUrl = '/ecm/service/feeds';
sendData(data, _tokenid: string): Observable<any> {
console.log( "inside send data" + JSON.stringify(data));
let authUrl = '/ecm/service/order'; // URL to web service
let authUrl = '/ecm/service'; // URL to web service
let siteCode = localStorage.getItem('SITE_CODE');
let _urlParams = new URLSearchParams();
_urlParams.append('tokenid', _tokenid);
console.log( "sendLogin 1...." + _urlParams.toString() );
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
authUrl = this.hostUrlService.hostUrl + authUrl + '?' + _urlParams.toString();
authUrl = this.hostUrlService.hostUrl + authUrl +'/' + siteCode + '/order'+'?' + _urlParams.toString();
console.log( "sendLogin 2...." + authUrl);
return this.http.post( authUrl, JSON.stringify(data) , options)
.map( (res) => this.extractData(res) );
......@@ -30,9 +32,9 @@ export class EcmCheckoutService {
getSalesRate (itemCode : string, custCode :string): Observable<any> {
console.log( "getSalesRate1.....[" + itemCode+"] custCode....["+custCode+"]");
let siteCode = localStorage.getItem('SITE_CODE');
itemCode=itemCode.trim();
let salesRateUrl = this.hostUrlService.hostUrl+this.SERVICE_URL + '/' + itemCode+'/'+custCode;
let salesRateUrl = this.hostUrlService.hostUrl+this.SERVICE_URL +'/' + siteCode + '/SalesRate/' + itemCode+'/'+custCode;
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
console.log( "getSalesRate 2...." + salesRateUrl);
......
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