Skip to content

Commit

Permalink
chore(api): update product search with custom operation
Browse files Browse the repository at this point in the history
  • Loading branch information
tleon committed Feb 19, 2024
1 parent 713c6aa commit 34f1b21
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ApiPlatform/Resources/FoundProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use PrestaShop\PrestaShop\Core\Domain\Product\Query\SearchProducts;
use PrestaShopBundle\ApiPlatform\Metadata\CQRSQueryCollection;
use PrestaShopBundle\ApiPlatform\Provider\QueryProvider;

#[ApiResource(
operations: [
new GetCollection(
new CQRSQueryCollection(
uriTemplate: '/products/search/{phrase}/{resultsLimit}/{isoCode}',
openapiContext: [
'parameters' => [
Expand Down Expand Up @@ -75,9 +75,7 @@
],
],
provider: QueryProvider::class,
extraProperties: [
'CQRSQuery' => SearchProducts::class,
]
CQRSQuery: SearchProducts::class
),
],
)]
Expand Down

0 comments on commit 34f1b21

Please sign in to comment.