| | |
| | | <apex:page controller="SearchLeadController" showHeader="false" id="page"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | |
| | | <head> |
| | | </head> |
| | |
| | | let requestSearchPayload = preparePayloadForSearchLead(); |
| | | 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 queryLeadBack = function(result){ |
| | | if(result.object&&result.object.length>0){ |
| | | initContactTable(result); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | AWSService.search(staticResources.searchUrl, requestSearchPayload, queryLeadBack, staticResources.token); |
| | | } |
| | | |
| | | function redirectToParentPage(obj) { |