Commit 8adceb63 authored by prumde's avatar prumde

Updated ecm-user-card.service.ts


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174266 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 28690954
...@@ -8,6 +8,7 @@ import { Store } from '@ngrx/store'; ...@@ -8,6 +8,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '../ecm-store/reducers'; import { AppState } from '../ecm-store/reducers';
import { SavedCardAction } from '../ecm-store/actions'; import { SavedCardAction } from '../ecm-store/actions';
import { Card } from './card-manager/card.model'; import { Card } from './card-manager/card.model';
import { HostUrlService } from '../host-url.service';
@Injectable() @Injectable()
...@@ -17,7 +18,7 @@ export class UserCardService { ...@@ -17,7 +18,7 @@ export class UserCardService {
userCard: Card[]; userCard: Card[];
constructor( private http: Http, private store: Store<AppState>, private savedcardActions: SavedCardAction ) { } constructor(public hostUrlService : HostUrlService, private http: Http, private store: Store<AppState>, private savedcardActions: SavedCardAction ) { }
loadUserCard() { loadUserCard() {
this.fetchUserCards().subscribe( this.fetchUserCards().subscribe(
...@@ -36,7 +37,7 @@ export class UserCardService { ...@@ -36,7 +37,7 @@ export class UserCardService {
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( this.userActionUrl+'cards', options ) return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl+'cards', options )
.map(( res ) => this.extractData( res ) ); .map(( res ) => this.extractData( res ) );
} }
...@@ -57,7 +58,7 @@ export class UserCardService { ...@@ -57,7 +58,7 @@ export class UserCardService {
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.post( this.userActionUrl+'card/', JSON.stringify( card ), options ) return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl+'card/', JSON.stringify( card ), options )
.map(( res ) => this.extractData( res ) ); .map(( res ) => this.extractData( res ) );
} }
...@@ -65,7 +66,7 @@ export class UserCardService { ...@@ -65,7 +66,7 @@ export class UserCardService {
deleteUserCard( card: Card ) { deleteUserCard( card: Card ) {
console.log( "deleteUserCard Called", card); console.log( "deleteUserCard Called", card);
return this.http.delete( this.userActionUrl + 'card/' + card.lineNo, {}) return this.http.delete( this.hostUrlService.hostUrl+this.userActionUrl + 'card/' + card.lineNo, {})
.map( res => res.json() ); .map( res => res.json() );
} }
......
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