Handle pages without ids in typeahead search

Bug: T313658
Change-Id: I6cba07e5e49d0593280017590dfd7cadb825095a
This commit is contained in:
bwang 2022-08-26 12:24:12 -05:00
parent 934f65ab57
commit 659a5244ac
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 );
return {
query,
results: restResponse.pages.map( ( page ) => {
results: restResponse.pages.map( ( page, index ) => {
const thumbnail = page.thumbnail;
return {
id: page.id,
value: page.id,
value: page.id || -( index + 1 ),
label: page.title,
key: page.key,
title: page.title,