Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 711950d

Browse files
authored
refactor #12420 [API] Adjust reset password requests (lchrusciel)
This PR was merged into the 1.10-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Continuation of #12391 <!-- - Bug fixes must be submitted against the 1.7 or 1.8 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 2fdd995 [API] Adjust reset password requests
2 parents 4322237 + 2fdd995 commit 711950d

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Sylius/Behat/Context/Api/Shop/LoginContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function iWantToLogIn(): void
6161
*/
6262
public function iWantToResetPassword(): void
6363
{
64-
$this->request = Request::create('shop', 'request-reset-password', 'Bearer');
64+
$this->request = Request::create('shop', 'reset-password-requests', 'Bearer');
6565
}
6666

6767
/**
@@ -81,7 +81,7 @@ public function iResetPasswordForEmailInLocale(string $email, string $localeCode
8181
public function iFollowLinkOnMyEmailToResetPassword(ShopUserInterface $user): void
8282
{
8383
$this->request = Request::custom(
84-
sprintf('api/v2/shop/reset-password/%s', $user->getPasswordResetToken()),
84+
sprintf('api/v2/shop/reset-password-requests/%s', $user->getPasswordResetToken()),
8585
HttpRequest::METHOD_PATCH
8686
);
8787
}

src/Sylius/Bundle/ApiBundle/Resources/config/api_resources/ResetPassword.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1616
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"
1717
>
18-
<resource class="Sylius\Bundle\ApiBundle\Command\ResetPassword" shortName="ResetPassword">
18+
<resource class="Sylius\Bundle\ApiBundle\Command\ResetPassword" shortName="ResetPasswordRequest">
1919
<attribute name="route_prefix">shop</attribute>
2020
<attribute name="validation_groups">sylius</attribute>
2121
<attribute name="messenger">input</attribute>
2222

2323
<collectionOperations>
24-
<collectionOperation name="shop_request_reset_password">
24+
<collectionOperation name="shop_create_reset_password_request">
2525
<attribute name="method">POST</attribute>
26-
<attribute name="path">/request-reset-password</attribute>
26+
<attribute name="path">/reset-password-requests</attribute>
2727
<attribute name="input">Sylius\Bundle\ApiBundle\Command\RequestResetPasswordToken</attribute>
2828
<attribute name="output">false</attribute>
2929
<attribute name="status">202</attribute>
@@ -37,9 +37,9 @@
3737
</collectionOperations>
3838

3939
<itemOperations>
40-
<itemOperation name="shop_reset_password">
40+
<itemOperation name="shop_update_reset_password_request">
4141
<attribute name="method">PATCH</attribute>
42-
<attribute name="path">/reset-password/{id}</attribute>
42+
<attribute name="path">/reset-password-requests/{id}</attribute>
4343
<attribute name="input">Sylius\Bundle\ApiBundle\Command\ResetPassword</attribute>
4444
<attribute name="output">false</attribute>
4545
<attribute name="status">202</attribute>

0 commit comments

Comments
 (0)