| | |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | fetch(postURL, { |
| | | method: 'POST', |
| | | body: payloadForNewPI, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | console.log('data=' + JSON.stringify(data)); |
| | | return data.json(); |
| | | }).then((result) => { |
| | | AWSService.post(postURL,payloadForNewPI,function(result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | }).catch(error => { |
| | | console.log('error'); |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(error),this.failStatus); |
| | | console.log(error); |
| | | }); |
| | | },token); |
| | | }, |
| | | AwsGet : function(url, data ,callback,token){ |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | fetch(url, { |
| | | method: 'GET', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | console.log('data=' + JSON.stringify(data)); |
| | | return data.json(); |
| | | }).then((result) => { |
| | | AWSService.get(url,function(result){ |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | }).catch(error => { |
| | | console.log('error'); |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(error),this.failStatus); |
| | | console.log(error); |
| | | }); |
| | | },token); |
| | | } |
| | | }) |