From 3d29090cfcde7bfb1b72de7e9d470a6a32931f3a Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 17 三月 2022 21:32:18 +0800
Subject: [PATCH] PIPLFunctionDeployV3

---
 force-app/main/default/pages/SearchContactPage.page |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/force-app/main/default/pages/SearchContactPage.page b/force-app/main/default/pages/SearchContactPage.page
index 67cb3b9..b09aeb7 100644
--- a/force-app/main/default/pages/SearchContactPage.page
+++ b/force-app/main/default/pages/SearchContactPage.page
@@ -1,4 +1,5 @@
 <apex:page controller="SearchContactController" showHeader="false" id="page">
+    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
     <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
 
     <head>
@@ -48,20 +49,26 @@
                 let requestSearchPayload = preparePayloadForSearchContact();
                 console.log('request payload body:'+requestSearchPayload);
                 //2. Invoke AWS Service
-                fetch(staticResources.searchUrl, {
-                    method: 'POST',
-                    body: requestSearchPayload,
-                    headers: {
-                        'Content-Type': 'application/json',
-                        'pi-token': staticResources.token
-                    }
-                }).then((data) => {
-                    return data.json();
-                }).then((result) => {
+                // fetch(staticResources.searchUrl, {
+                //     method: 'POST',
+                //     body: requestSearchPayload,
+                //     headers: {
+                //         'Content-Type': 'application/json',
+                //         'pi-token': staticResources.token
+                //     }
+                // }).then((data) => {
+                //     return data.json();
+                // }).then((result) => {
+                //     if(result.object&&result.object.length>0){
+                //         initContactTable(result);
+                //     }                   
+                // })
+                let queryBackContactName = function queryBackContactName(result){
                     if(result.object&&result.object.length>0){
                         initContactTable(result);
-                    }                   
-                })
+                    } 
+                };
+                AWSService.search(staticResources.searchUrl,requestSearchPayload,queryBackContactName,staticResources.token)
             }
             
             function redirectToParentPage(obj) {

--
Gitblit v1.9.1