Skip to content

Commit a29ecf4

Browse files
author
Vitaliy Boyko
committed
graphQl-352: removed redundant dataprovider
1 parent 6293ca7 commit a29ecf4

File tree

2 files changed

+7
-47
lines changed

2 files changed

+7
-47
lines changed

app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\CustomerGraphQl\Model\Resolver;
99

10-
use Magento\CustomerGraphQl\Model\Customer\IsEmailAvailableDataProvider;
10+
use Magento\Customer\Api\AccountManagementInterface;
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1313
use Magento\Framework\GraphQl\Query\ResolverInterface;
@@ -19,17 +19,17 @@
1919
class IsEmailAvailable implements ResolverInterface
2020
{
2121
/**
22-
* @var IsEmailAvailableDataProvider
22+
* @var AccountManagementInterface
2323
*/
24-
private $isEmailAvailableDataProvider;
24+
private $accountManagement;
2525

2626
/**
27-
* @param IsEmailAvailableDataProvider $isEmailAvailableDataProvider
27+
* @param AccountManagementInterface $accountManagement
2828
*/
2929
public function __construct(
30-
IsEmailAvailableDataProvider $isEmailAvailableDataProvider
30+
AccountManagementInterface $accountManagement
3131
) {
32-
$this->isEmailAvailableDataProvider = $isEmailAvailableDataProvider;
32+
$this->accountManagement = $accountManagement;
3333
}
3434

3535
/**
@@ -46,7 +46,7 @@ public function resolve(
4646
if (!$email) {
4747
throw new GraphQlInputException(__('"Email should be specified'));
4848
}
49-
$isEmailAvailable = $this->isEmailAvailableDataProvider->execute($email);
49+
$isEmailAvailable = $this->accountManagement->isEmailAvailable($email);
5050

5151
return [
5252
'is_email_available' => $isEmailAvailable

0 commit comments

Comments
 (0)