File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
document . addEventListener ( 'DOMContentLoaded' , async function ( ) {
2
2
3
3
// Netlify function to get the coveo search token via API
4
- async function getSearchToken ( ) {
4
+ async function getsearchObj ( ) {
5
5
const response = await fetch (
6
6
window . location . origin + "/api/v1/auth/search_token"
7
7
) ;
8
8
return response . json ( ) ;
9
9
}
10
10
11
- const searchToken = await getSearchToken ( )
12
- Coveo . SearchEndpoint . configureCloudV2Endpoint ( "" , searchToken . token ) ;
11
+ const searchObj = await getsearchObj ( )
12
+ Coveo . SearchEndpoint . configureCloudV2Endpoint ( searchObj . org_id , searchObj . token , `https:// ${ searchObj . org_id } .org.coveo.com/rest/search` ) ;
13
13
14
14
const root = document . getElementById ( "search" ) ;
15
15
const searchBoxRoot = document . getElementById ( "searchbox" ) ;
You can’t perform that action at this time.
0 commit comments