File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
app/code/Magento/CustomerGraphQl/Model Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ public function execute(CustomerInterface $customer): array
102
102
}
103
103
$ customerData = array_merge ($ customerData , $ customAttributes );
104
104
105
+ $ customerData ['model ' ] = $ customer ;
105
106
return $ customerData ;
106
107
}
107
108
}
Original file line number Diff line number Diff line change 11
11
use Magento \CustomerGraphQl \Model \Customer \CheckCustomerPassword ;
12
12
use Magento \CustomerGraphQl \Model \Customer \ExtractCustomerData ;
13
13
use Magento \CustomerGraphQl \Model \Customer \GetCustomer ;
14
+ use Magento \Framework \Exception \LocalizedException ;
14
15
use Magento \Framework \GraphQl \Config \Element \Field ;
15
16
use Magento \Framework \GraphQl \Exception \GraphQlInputException ;
16
17
use Magento \Framework \GraphQl \Query \ResolverInterface ;
@@ -81,8 +82,12 @@ public function resolve(
81
82
$ customerId = (int )$ customer ->getId ();
82
83
83
84
$ this ->checkCustomerPassword ->execute ($ args ['currentPassword ' ], $ customerId );
84
- $ this ->accountManagement ->changePasswordById ($ customerId , $ args ['currentPassword ' ], $ args ['newPassword ' ]);
85
85
86
+ try {
87
+ $ this ->accountManagement ->changePasswordById ($ customerId , $ args ['currentPassword ' ], $ args ['newPassword ' ]);
88
+ } catch (LocalizedException $ e ) {
89
+ throw new GraphQlInputException (__ ($ e ->getMessage ()), $ e );
90
+ }
86
91
return $ this ->extractCustomerData ->execute ($ customer );
87
92
}
88
93
}
You can’t perform that action at this time.
0 commit comments