From 25229102ce354a723f32e38e15100ad0b39bcb21 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Tue, 8 Oct 2024 12:15:10 -0700 Subject: [PATCH] changed to use env var for org_id --- assets/js/coveo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/coveo.js b/assets/js/coveo.js index 9dbf55a..ee52d14 100644 --- a/assets/js/coveo.js +++ b/assets/js/coveo.js @@ -1,15 +1,15 @@ document.addEventListener('DOMContentLoaded', async function () { // Netlify function to get the coveo search token via API - async function getSearchToken() { + async function getsearchObj() { const response = await fetch( window.location.origin+"/api/v1/auth/search_token" ); return response.json(); } - const searchToken = await getSearchToken() - Coveo.SearchEndpoint.configureCloudV2Endpoint("f5networkx1h1607h", searchToken.token, "https://f5networkx1h1607h.org.coveo.com/rest/search"); + const searchObj = await getsearchObj() + Coveo.SearchEndpoint.configureCloudV2Endpoint(searchObj.org_id, searchObj.token, `https://${searchObj.org_id}.org.coveo.com/rest/search`); const root = document.getElementById("search"); const searchBoxRoot = document.getElementById("searchbox");