Skip to content

Commit 73404e3

Browse files
author
Valeriy Nayda
committed
GraphQL-54: [Mutations] My Account: Change Password
1 parent a17d437 commit 73404e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer/Account/ChangePassword.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\CustomerGraphQl\Model\Resolver\Customer\CustomerDataProvider;
1414
use Magento\Framework\GraphQl\Config\Element\Field;
1515
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
16-
use Magento\Framework\GraphQl\Query\Resolver\Value;
16+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1717
use Magento\Framework\GraphQl\Query\ResolverInterface;
1818
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1919

@@ -61,8 +61,8 @@ public function resolve(
6161
ResolveInfo $info,
6262
array $value = null,
6363
array $args = null
64-
): Value {
65-
$customerId = (int) $this->userContext->getUserId();
64+
) {
65+
$customerId = (int)$this->userContext->getUserId();
6666

6767
if ($customerId === 0) {
6868
throw new GraphQlAuthorizationException(
@@ -81,6 +81,6 @@ public function resolve(
8181
$this->accountManagement->changePasswordById($customerId, $args['currentPassword'], $args['newPassword']);
8282
$data = $this->customerResolver->getCustomerById($customerId);
8383

84-
return !empty($data) ? $data : [];
84+
return $data;
8585
}
8686
}

0 commit comments

Comments
 (0)