Commit b6c467f7 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@174528 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2edc01cf
......@@ -8,6 +8,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '../ecm-store/reducers';
import { SavedCardAction } from '../ecm-store/actions';
import { Card } from './card-manager/card.model';
import { HostUrlService } from '../host-url.service';
@Injectable()
......@@ -17,7 +18,7 @@ export class UserCardService {
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() {
this.fetchUserCards().subscribe(
......@@ -36,7 +37,7 @@ export class UserCardService {
let headers = new Headers( { 'Content-Type': 'application/json' });
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 ) );
}
......@@ -57,7 +58,7 @@ export class UserCardService {
let headers = new Headers( { 'Content-Type': 'application/json' });
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 ) );
}
......@@ -65,7 +66,7 @@ export class UserCardService {
deleteUserCard( card: 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() );
}
......
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