Why is my FAQ accordion functionality only partially working?

I have figured out that the following code in the .js file is only returning the section ID for the first section, so the javascript never gets applied to the subsequent FAQ sections on that page.

How do I update this so it returns successive section IDs each time the .js file runs please?

function getConfig() {
    return JSON.parse(document.querySelector('[data-faq-config]').innerHTML);
}

@Mircea_Piturca any tips for your code please?