From de461a62bee637a771616b178601b4d1497d8cd8 Mon Sep 17 00:00:00 2001 From: Tyrone Tse Date: Thu, 22 Feb 2024 13:18:24 -0600 Subject: [PATCH] Added code to get the Search Collection Index from the configuration file admin-config.json which is stored in a new property searchCollectionIndex e.g. { "ID": "searchCollectionIndex", "Value": "108396-1046543_collections" } --- scripts/collections.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/collections.js b/scripts/collections.js index c9ab5062..bc8679d2 100644 --- a/scripts/collections.js +++ b/scripts/collections.js @@ -6,6 +6,9 @@ import { import { getPathParams, logError } from './scripts.js'; import { emitEvent, EventNames } from './events.js'; +import { + getAdminConfig, } from './site-config.js'; + export function getCollectionIdFromURL() { if (window.location.pathname.includes('/collection/')) { return getPathParams().at(-1); @@ -226,8 +229,8 @@ export async function searchListCollection(limit = undefined, page = 0) { queryParams.append('page', page); } - //Todo add the indexName in a config file hardcode for now - const indexName ="108396-1046543_collections"; + const adminConfig=await getAdminConfig(); + const indexName=adminConfig.searchCollectionIndex; const data = { "requests": [