Skip to content

Commit

Permalink
Merge pull request #350 from PrestaShopCorp/fix/5.x/header-shop-id
Browse files Browse the repository at this point in the history
fix: replace shop id with shop uuid
  • Loading branch information
hschoenenberger authored Jun 19, 2023
2 parents 42f9b02 + 226d2d5 commit 8a54bb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/Api/Client/AccountsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function refreshToken($refreshToken)
*/
public function deleteUserShop($shopId)
{
return $this->shopProvider->getShopContext()->execInShopContext((int) $shopId, function () use ($shopId) {
return $this->shopProvider->getShopContext()->execInShopContext((int) $shopId, function () {
$userToken = $this->getUserTokenRepository();
$shopToken = $this->getShopTokenRepository();

Expand All @@ -132,7 +132,7 @@ public function deleteUserShop($shopId)
return $this->delete([
'headers' => $this->getHeaders([
'Authorization' => 'Bearer ' . $userToken->getOrRefreshToken(),
'X-Shop-Id' => $shopId,
'X-Shop-Id' => $shopToken->getTokenUuid(),
]),
]);
});
Expand All @@ -155,7 +155,7 @@ public function reonboardShop($currentShop)
return $this->post([
'headers' => $this->getHeaders([
'Authorization' => 'Bearer ' . $shopToken->getOrRefreshToken(),
'X-Shop-Id' => $currentShop['id'],
'X-Shop-Id' => $currentShop['uuid'],
]),
'json' => $currentShop,
]);
Expand Down Expand Up @@ -190,7 +190,7 @@ public function updateUserShop(UpdateShop $shop)
return $this->patch([
'headers' => $this->getHeaders([
'Authorization' => 'Bearer ' . $userToken->getOrRefreshToken(),
'X-Shop-Id' => $shop->shopId,
'X-Shop-Id' => $shopToken->getTokenUuid(),
]),
'json' => $shop->jsonSerialize(),
]);
Expand Down

0 comments on commit 8a54bb6

Please sign in to comment.