Commit 605ed6d7 authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174985 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 321984de
...@@ -10,21 +10,25 @@ import { HostUrlService } from '../../host-url.service'; ...@@ -10,21 +10,25 @@ import { HostUrlService } from '../../host-url.service';
@Injectable() @Injectable()
export class EcmRecentViewService { export class EcmRecentViewService {
private recentViewUrl = '/ecm/service/feeds/recentview'; // URL to web service // private recentViewUrl = '/ecm/service/feeds/L2D01/recentview'; // URL to web service
private recentViewUrl = '/ecm/service/feeds';
constructor (private http: Http,public hostUrlService : HostUrlService) {} constructor (private http: Http,public hostUrlService : HostUrlService) {}
getRecentViewItems(): Observable<Item[]> { getRecentViewItems(): Observable<Item[]> {
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.recentViewUrl, options )
return this.http.get( this.hostUrlService.hostUrl+this.recentViewUrl + '/' + siteCode + '/recentview', options )
.map( (res) => this.extractData(res) ) .map( (res) => this.extractData(res) )
.catch( this.handleError ); .catch( this.handleError );
} }
storeRecentViewItem(itemCode) { storeRecentViewItem(itemCode) {
this.http.post(this.hostUrlService.hostUrl+this.recentViewUrl+'/'+itemCode, {}) let siteCode = localStorage.getItem('SITE_CODE');
this.http.post(this.hostUrlService.hostUrl+this.recentViewUrl + '/' + siteCode + '/recentview' + '/' + itemCode, {})
.subscribe(data => { .subscribe(data => {
console.log("Inserted in RecentView"); console.log("Inserted in RecentView");
}, error => { }, error => {
......
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