Commit 350ce21b authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174991 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7dba76a5
......@@ -14,8 +14,9 @@ import { HostUrlService } from '../host-url.service';
@Injectable()
export class UserCardService {
private userActionUrl = '/ecm/service/feeds/';
// private userActionUrl = '/ecm/service/feeds/L2D01/';
private userActionUrl = '/ecm/service/feeds';
userCard: Card[];
constructor(public hostUrlService : HostUrlService, private http: Http, private store: Store<AppState>, private savedcardActions: SavedCardAction ) { }
......@@ -36,8 +37,9 @@ export class UserCardService {
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl+'cards', options )
return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode + '/' +'cards', options )
.map(( res ) => this.extractData( res ) );
}
......@@ -46,8 +48,9 @@ export class UserCardService {
console.log( JSON.stringify( userCard ) );
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.post( '', JSON.stringify( userCard ), options )
return this.http.post( this.hostUrlService.hostUrl + this.userActionUrl + '/' + siteCode + '/' + 'card/', JSON.stringify( userCard ), options )
.map(( res ) => this.extractData( res ) );
}
......@@ -57,16 +60,18 @@ export class UserCardService {
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl+'card/', JSON.stringify( card ), options )
return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl+ '/' + siteCode + '/' +'card/', JSON.stringify( card ), options )
.map(( res ) => this.extractData( res ) );
}
deleteUserCard( card: Card ) {
console.log( "deleteUserCard Called", card);
let siteCode = localStorage.getItem('SITE_CODE');
return this.http.delete( this.hostUrlService.hostUrl+this.userActionUrl + 'card/' + card.lineNo, {})
return this.http.delete( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode + '/' + '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