From 03523642de0c4f319d90d0aec8a756f9e80e6a7e Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 17 三月 2022 21:27:47 +0800
Subject: [PATCH] PIPLFunctionDeployV2

---
 force-app/main/default/aura/NewAgencyContact/NewAgencyContactHelper.js |   35 ++++-------------------------------
 1 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/force-app/main/default/aura/NewAgencyContact/NewAgencyContactHelper.js b/force-app/main/default/aura/NewAgencyContact/NewAgencyContactHelper.js
index e3d4714..9ca0c00 100644
--- a/force-app/main/default/aura/NewAgencyContact/NewAgencyContactHelper.js
+++ b/force-app/main/default/aura/NewAgencyContact/NewAgencyContactHelper.js
@@ -25,24 +25,10 @@
             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){
         
@@ -56,22 +42,9 @@
             }
         }
         
-        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);
     }
 })
\ No newline at end of file

--
Gitblit v1.9.1