Skip to content

Commit

Permalink
Added code to get the Search Collection Index from the configuration …
Browse files Browse the repository at this point in the history
…file admin-config.json

which is stored in a new property searchCollectionIndex e.g.
        {
            "ID": "searchCollectionIndex",
            "Value": "108396-1046543_collections"
        }
  • Loading branch information
TyroneAEM committed Feb 22, 2024
1 parent 2e4adf0 commit de461a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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": [
Expand Down

0 comments on commit de461a6

Please sign in to comment.