Skip to content

Commit

Permalink
Merge pull request PrestaShop#16 from jolelievre/product-context
Browse files Browse the repository at this point in the history
Update product endpoint query mapping to match new path for context values
  • Loading branch information
jolelievre authored Feb 26, 2024
2 parents 482a224 + d235c23 commit dc19a0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ApiPlatform/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
],
CQRSQueryMapping: Product::QUERY_MAPPING,
CQRSCommandMapping: [
'[_context][shopId]' => '[shopId]',
'[type]' => '[productType]',
'[names]' => '[localizedNames]',
],
Expand All @@ -81,6 +82,9 @@
scopes: [
'product_write',
],
CQRSQueryMapping: [
'[_context][shopConstraint]' => '[shopConstraint]',
]
),
],
exceptionToStatus: [
Expand All @@ -102,12 +106,14 @@ class Product
public array $descriptions;

public const QUERY_MAPPING = [
'[langId]' => '[displayLanguageId]',
'[_context][shopConstraint]' => '[shopConstraint]',
'[_context][langId]' => '[displayLanguageId]',
'[basicInformation][localizedNames]' => '[names]',
'[basicInformation][localizedDescriptions]' => '[descriptions]',
];

public const UPDATE_MAPPING = [
'[_context][shopConstraint]' => '[shopConstraint]',
'[type]' => '[productType]',
'[names]' => '[localizedNames]',
'[descriptions]' => '[localizedDescriptions]',
Expand Down

0 comments on commit dc19a0c

Please sign in to comment.