Commit cf6ba4d7 authored by prumde's avatar prumde

Updated ecm-recent-view.service.ts


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174260 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c6ca7baa
......@@ -5,25 +5,26 @@ import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import { Item } from '../../ecm-model/product-model';
import { HostUrlService } from '../../host-url.service';
@Injectable()
export class EcmRecentViewService {
private recentViewUrl = '/ecm/service/feeds/recentview'; // URL to web service
constructor (private http: Http) {}
constructor (private http: Http,public hostUrlService : HostUrlService) {}
getRecentViewItems(): Observable<Item[]> {
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
return this.http.get( this.recentViewUrl, options )
return this.http.get( this.hostUrlService.hostUrl+this.recentViewUrl, options )
.map( (res) => this.extractData(res) )
.catch( this.handleError );
}
storeRecentViewItem(itemCode) {
this.http.post(this.recentViewUrl+'/'+itemCode, {})
this.http.post(this.hostUrlService.hostUrl+this.recentViewUrl+'/'+itemCode, {})
.subscribe(data => {
console.log("Inserted in RecentView");
}, 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