From 98d683612c9ac4dbed79557bf868cb395fd98fe2 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Wed, 15 Nov 2017 14:46:04 +0000 Subject: [PATCH] fixed HTTP posts --- src/app/providers/api-service.ts | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts index cc1fdf7..d6ffe18 100644 --- a/src/app/providers/api-service.ts +++ b/src/app/providers/api-service.ts @@ -20,7 +20,7 @@ export class ApiService { public post(url: string, data: any = {}) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + url, data ); @@ -46,7 +46,7 @@ export class ApiService { } public register(data) { - return this.http.post( + return this.http.post( this.apiUrl + '/register', data ); @@ -54,13 +54,13 @@ export class ApiService { public login(data) { return this.http - .post( + .post( this.apiUrl + '/login', data ) .map( result => { - const json = result.json(); + const json = result; this.setSessionKey(json.session_key); this.setUserInfo( json.email, @@ -76,7 +76,7 @@ export class ApiService { console.log(this.sessionKey); const key = this.sessionKey; return this.http - .post( + .post( this.apiUrl + '/logout', { session_key : key }, ) @@ -84,7 +84,7 @@ export class ApiService { response => { localStorage.clear(); this.sessionKey = null; - return response.json(); + return response; } ); } @@ -97,7 +97,7 @@ export class ApiService { data.version_code = 'dev'; data.version_number = 'dev'; console.log(data); - return this.http.post( + return this.http.post( this.apiUrl + '/feedback', data ); @@ -107,7 +107,7 @@ export class ApiService { public transList(data) { const key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/outgoing-transactions', { session_key : key, @@ -120,7 +120,7 @@ export class ApiService { public search(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/search', data ); @@ -130,7 +130,7 @@ export class ApiService { public upload(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/upload', data ); @@ -140,7 +140,7 @@ export class ApiService { public payrollList(data) { const key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/v1/organisation/payroll', { session_key : key, @@ -153,7 +153,7 @@ export class ApiService { public orgPayroll(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/v1/organisation/payroll/add', data ); @@ -161,7 +161,7 @@ export class ApiService { public orgSupplier(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/v1/organisation/supplier/add', data ); @@ -169,7 +169,7 @@ export class ApiService { public orgEmployee(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/v1/organisation/employee/add', data ); @@ -204,7 +204,7 @@ export class ApiService { public accountFullLoad() { const key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/user', { session_key : key }, ); @@ -212,7 +212,7 @@ export class ApiService { public accountEditUpdate(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/user/account', data ); @@ -257,7 +257,7 @@ export class ApiService { type: string, page: number) { const key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/stats/leaderboard/paged', { session_key : key, @@ -270,7 +270,7 @@ export class ApiService { // Initial Map Data public getMapData(data) { data.session_key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/v1/supplier/location', data ); @@ -279,7 +279,7 @@ export class ApiService { // Basic Customer User stats API public basicStats() { const key = this.sessionKey; - return this.http.post( + return this.http.post( this.apiUrl + '/stats', { session_key : key,