Merge "Handle pages without ids in typeahead search"

This commit is contained in:
jenkins-bot 2022-08-29 21:46:49 +00:00 committed by Gerrit Code Review
commit 0d957abf77
1 changed files with 2 additions and 2 deletions

View File

@ -37,11 +37,11 @@ function adaptApiResponse( config, query, restResponse, showDescription ) {
const urlGeneratorInstance = urlGenerator( config ); const urlGeneratorInstance = urlGenerator( config );
return { return {
query, query,
results: restResponse.pages.map( ( page ) => { results: restResponse.pages.map( ( page, index ) => {
const thumbnail = page.thumbnail; const thumbnail = page.thumbnail;
return { return {
id: page.id, id: page.id,
value: page.id, value: page.id || -( index + 1 ),
label: page.title, label: page.title,
key: page.key, key: page.key,
title: page.title, title: page.title,