Commit 76874dca authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174982 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 25942503
...@@ -11,22 +11,24 @@ import { HostUrlService } from '../../host-url.service'; ...@@ -11,22 +11,24 @@ import { HostUrlService } from '../../host-url.service';
@Injectable() @Injectable()
export class EcmCategoryService { export class EcmCategoryService {
private SERVICE_URL = '/ecm/service/category'; // URL to web service // private SERVICE_URL = '/ecm/service/L2D01/category'; // URL to web service
private SERVICE_URL = '/ecm/service';
constructor (private http: Http,public hostUrlService : HostUrlService) {} constructor (private http: Http,public hostUrlService : HostUrlService) {}
getCategories(): Observable<Category[]> { getCategories(): Observable<Category[]> {
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');
console.log('inside get category'+this.hostUrlService.hostUrl) console.log('inside get category'+this.hostUrlService.hostUrl)
return this.http.get( this.hostUrlService.hostUrl+this.SERVICE_URL, options ) return this.http.get( this.hostUrlService.hostUrl+this.SERVICE_URL + '/' + siteCode + '/category', options )
.map( this.extractData ) .map( this.extractData )
.catch( this.handleError ); .catch( this.handleError );
} }
getCategory (catCode : string): Observable<Category> { getCategory (catCode : string): Observable<Category> {
let categoryUrl = this.hostUrlService.hostUrl+this.SERVICE_URL + '/' + catCode; let siteCode = localStorage.getItem('SITE_CODE');
let categoryUrl = this.hostUrlService.hostUrl+this.SERVICE_URL + '/' + siteCode + '/category' + '/' + catCode;
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 });
...@@ -38,8 +40,8 @@ export class EcmCategoryService { ...@@ -38,8 +40,8 @@ export class EcmCategoryService {
getSideOptions(): Observable<any> { getSideOptions(): Observable<any> {
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.SERVICE_URL + '/summary', options ) return this.http.get( this.hostUrlService.hostUrl+this.SERVICE_URL + '/' + siteCode + '/category' + '/summary', options )
.map( this.extractData ) .map( this.extractData )
.catch( this.handleError ); .catch( this.handleError );
} }
......
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