mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-27 11:41:36 +00:00
Fixed exception in LCSCProvider
This commit is contained in:
parent
16bb09c153
commit
07d106e44d
1 changed files with 3 additions and 1 deletions
|
|
@ -151,7 +151,7 @@ class LCSCProvider implements BatchInfoProviderInterface, URLHandlerInfoProvider
|
|||
|
||||
//If we get exact matches, use them
|
||||
if (!empty($arr['result']['exactMatchResult'])) {
|
||||
$products = $arr['result']['a'];
|
||||
$products = $arr['result']['exactMatchResult'];
|
||||
} else { //Otherwise fallback onto the third search endpoint, which has a worse data quality but is more likely to return results for vague search terms
|
||||
$response = $this->lcscClient->request('POST', self::ENDPOINT_URL."/search/third", [
|
||||
'headers' => [
|
||||
|
|
@ -170,6 +170,8 @@ class LCSCProvider implements BatchInfoProviderInterface, URLHandlerInfoProvider
|
|||
$products = $arr['result']['productList'] ?? [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($products as $product) {
|
||||
$result[] = $this->getPartDetail($product, $lightweight);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue