src/components/search-segment.js
// Returns a list of searchable proposals compliant to the format of the search component.
Returns a list of searchable proposals compliant to the format of the search component.
Returns a list of searchable proposals compliant to the format of the search component .
function prepareSearchElements(searchables) {
        const tmp = [];
        if (searchables) {
            for (let el of searchables) {
                const elJson = {
                    title: el?.metadata?.header ?? 'NOT_PROVIDED',
                    description: el?.metadata?.creationDate ?? 'NOT_PROVIDED',
                    skylink: el?.skylink ?? 'NOT_PROVIDED',
                    commentsSkylink: el?.commentsSkylink ?? 'NOT_PROVIDED',
                    likes: el?.likes ?? 'NOT_PROVIDED',
                    header: el?.metadata?.header ?? 'NOT_PROVIDED',
                    creator: el?.metadata?.creator ?? 'NOT_PROVIDED',
                    creationdate: el?.metadata?.creationDate ?? 'NOT_PROVIDED'
                }
                tmp.push(elJson);
            }
        }
        return tmp;
    }
function prepareSearchElements ( searchables ) { const tmp = [ ] ; if ( searchables ) { for ( let el of searchables ) { const elJson = { title : el ?. metadata ?. header ?? 'NOT_PROVIDED' , description : el ?. metadata ?. creationDate ?? 'NOT_PROVIDED' , skylink : el ?. skylink ?? 'NOT_PROVIDED' , commentsSkylink : el ?. commentsSkylink ?? 'NOT_PROVIDED' , likes : el ?. likes ?? 'NOT_PROVIDED' , header : el ?. metadata ?. header ?? 'NOT_PROVIDED' , creator : el ?. metadata ?. creator ?? 'NOT_PROVIDED' , creationdate : el ?. metadata ?. creationDate ?? 'NOT_PROVIDED' } tmp . push ( elJson ) ; } } return tmp ; }
Returns a list of searchable proposals compliant to the format of the search component.
Returns a list of searchable proposals compliant to the format of the search component .