[API] Change endpoint for customer verification

This commit is contained in:
Rafikooo 2024-03-08 16:33:22 +01:00
parent 295901a0cd
commit 0bc418fd88
No known key found for this signature in database
GPG key ID: 4A26D8327BC2442B
4 changed files with 8 additions and 8 deletions

View file

@ -457,7 +457,7 @@ final class CustomerContext implements Context
private function verifyAccount(string $token): void
{
$request = $this->requestFactory->custom(
\sprintf('%s/shop/account-verification-requests/%s', $this->apiUrlPrefix, $token),
\sprintf('%s/shop/customers/verify/%s', $this->apiUrlPrefix, $token),
HttpRequest::METHOD_PATCH,
);
@ -480,7 +480,7 @@ final class CustomerContext implements Context
private function resendVerificationEmail(string $email): void
{
$request = $this->requestFactory->create('shop', 'account-verification-requests', 'Bearer');
$request = $this->requestFactory->create('shop', 'customers/verify', 'Bearer');
$request->setContent(['email' => $email]);

View file

@ -108,7 +108,7 @@ final class RegistrationContext implements Context
$token = $customer->getUser()->getEmailVerificationToken();
$request = $this->requestFactory->custom(
\sprintf('%s/shop/account-verification-requests/%s', $this->apiUrlPrefix, $token),
\sprintf('%s/shop/customers/verify/%s', $this->apiUrlPrefix, $token),
HttpRequest::METHOD_PATCH,
);
$this->shopClient->executeCustomRequest($request);

View file

@ -24,7 +24,7 @@
<collectionOperations>
<collectionOperation name="shop_resend_verification_email">
<attribute name="method">POST</attribute>
<attribute name="path">/account-verification-requests</attribute>
<attribute name="path">/customers/verify</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Account\ResendVerificationEmail</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">
@ -43,7 +43,7 @@
<itemOperations>
<itemOperation name="shop_verify_customer_account">
<attribute name="method">PATCH</attribute>
<attribute name="path">/account-verification-requests/{token}</attribute>
<attribute name="path">/customers/verify/{token}</attribute>
<attribute name="input">Sylius\Bundle\ApiBundle\Command\Account\VerifyCustomerAccount</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">

View file

@ -30,7 +30,7 @@ final class VerifyCustomerAccountsTest extends JsonApiTestCase
$this->client->request(
method: 'POST',
uri: '/api/v2/shop/account-verification-requests',
uri: '/api/v2/shop/customers/verify',
server: $header,
content: '{}',
);
@ -49,7 +49,7 @@ final class VerifyCustomerAccountsTest extends JsonApiTestCase
$this->client->request(
method: 'POST',
uri: '/api/v2/shop/account-verification-requests',
uri: '/api/v2/shop/customers/verify',
server: self::CONTENT_TYPE_HEADER,
);
@ -71,7 +71,7 @@ final class VerifyCustomerAccountsTest extends JsonApiTestCase
$this->client->request(
method: 'PATCH',
uri: '/api/v2/shop/account-verification-requests/token',
uri: '/api/v2/shop/customers/verify/token',
server: self::PATCH_CONTENT_TYPE_HEADER,
content: '{}',
);