mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-18 10:51:10 +00:00
Merge "Handle pages without ids in typeahead search"
This commit is contained in:
commit
0d957abf77
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue