async function getTsOptions()

in wiki-interface/lib/api/v1.js [91:117]


async function getTsOptions(projectId) {

    /* Loading Wiki data */
    let wikiList = await gitlabOperator.listWiki(projectId);

    let options = [];

    /* Sorting Data */
    wikiList = wikiList.sort(function (a, b) {
        let x = a.title.toLowerCase();
        let y = b.title.toLowerCase();
        if (x > y) { return 1; }
        if (x < y) { return -1; }
        return 0;
    });

    for (let thisWiki of wikiList) {
        if (thisWiki.title.includes(configFile.getGeneratorsufix())) {
            let thisOption = {
                value: thisWiki.slug,
                label: thisWiki.title
            }
            options.push(thisOption);
        }
    }
    return options;
}