This commit is contained in:
2024-01-06 17:08:33 +01:00
parent 9f9420643e
commit e4eec833a9
6 changed files with 100 additions and 42 deletions

View File

@@ -35,10 +35,10 @@ class ProductsCompareController extends Controller
$cHash = CountryCode::code_countryHash();
if (is_array($codes) == false)
$aCodes = [$codes['code']];
$aCodes = $codes;
else
$aCodes = $codes->map(function ($code) {
return $code['code'];
return $code;
});
$products = IkeaProducts::whereIn("code", $aCodes);
@@ -57,9 +57,9 @@ class ProductsCompareController extends Controller
return $product;
});
Log::info("{products}", ["products" => $products]);
return Inertia::render('IkeaRoot', [
return [
'products' => $products,
'countryHash' => $cHash,
]);
];
}
}