Commit 185b4c30 authored by prumde's avatar prumde

Updated ecm-user-review.service.ts


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174530 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1c90e1f5
...@@ -9,6 +9,7 @@ import { AppState } from '../ecm-store/reducers'; ...@@ -9,6 +9,7 @@ import { AppState } from '../ecm-store/reducers';
import { ReviewAction } from '../ecm-store/actions'; import { ReviewAction } from '../ecm-store/actions';
import { Review } from './review-manager/review.model'; import { Review } from './review-manager/review.model';
import { Reviews } from '../ecm-model/product-review.model'; import { Reviews } from '../ecm-model/product-review.model';
import { HostUrlService } from '../host-url.service';
@Injectable() @Injectable()
export class UserReviewService { export class UserReviewService {
...@@ -19,7 +20,7 @@ export class UserReviewService { ...@@ -19,7 +20,7 @@ export class UserReviewService {
value; value;
constructor( private http: Http, private store: Store<AppState>, private reviewActions: ReviewAction ) { } constructor( public hostUrlService : HostUrlService,private http: Http, private store: Store<AppState>, private reviewActions: ReviewAction ) { }
loadUserReview() { loadUserReview() {
this.fetchUserInfo().subscribe( this.fetchUserInfo().subscribe(
...@@ -64,12 +65,12 @@ export class UserReviewService { ...@@ -64,12 +65,12 @@ export class UserReviewService {
getUserReview( itemCode ) { getUserReview( itemCode ) {
let getUserReviewUrl = '/ecm/service/feeds/review/'; let getUserReviewUrl = '/ecm/service/feeds/review/';
getUserReviewUrl = getUserReviewUrl + itemCode; getUserReviewUrl = getUserReviewUrl + itemCode;
console.log( "URL: " + getUserReviewUrl ); console.log( "URL: " + this.hostUrlService.hostUrl+getUserReviewUrl );
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 });
return this.http.get( getUserReviewUrl, options ) return this.http.get( this.hostUrlService.hostUrl+getUserReviewUrl, options )
.map( this.extractData ) .map( this.extractData )
.catch( this.handleError ); .catch( this.handleError );
} }
...@@ -82,7 +83,7 @@ export class UserReviewService { ...@@ -82,7 +83,7 @@ export class UserReviewService {
console.log("Submitting Review..."); console.log("Submitting Review...");
console.log(JSON.stringify(reviewData)); console.log(JSON.stringify(reviewData));
this.http.post(userServiceUrl, reviewData, options) this.http.post(this.hostUrlService.hostUrl+userServiceUrl, reviewData, options)
.subscribe(data => { .subscribe(data => {
console.log("Add Review"); console.log("Add Review");
}, error => { }, error => {
...@@ -97,7 +98,7 @@ export class UserReviewService { ...@@ -97,7 +98,7 @@ export class UserReviewService {
console.log("Deleting Review for...",itemCode); console.log("Deleting Review for...",itemCode);
this.http.delete(userServiceUrl+itemCode, options) this.http.delete(this.hostUrlService.hostUrl+userServiceUrl+itemCode, options)
.subscribe(data => { .subscribe(data => {
console.log("Deleted Review"); console.log("Deleted Review");
}, 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