add the locale to the search result

This commit is contained in:
Rev 2021-10-11 17:34:51 +09:00
parent 5b8f54b138
commit c7fd49e553

View File

@ -45,6 +45,7 @@ class ItemsCollection
return [ return [
'_id' => $item['_id'], '_id' => $item['_id'],
'_name' => $item['_name'], '_name' => $item['_name'],
'locale' => $this->locale[$item['_id']] ?? ''
]; ];
})->values(); })->values();
} }
@ -59,7 +60,6 @@ class ItemsCollection
$item = $this->items[$id] ?? throw new ItemNotFoundException('Item not found'); $item = $this->items[$id] ?? throw new ItemNotFoundException('Item not found');
return [ return [
'item' => $item, 'item' => $item,
'locale' => $this->locale[$id] ?? ''
]; ];
} }
} }