File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/CustomerGraphQl/Model/Resolver Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 77
88namespace Magento \CustomerGraphQl \Model \Resolver ;
99
10+ use Magento \Customer \Api \Data \CustomerInterface ;
1011use Magento \Framework \Exception \LocalizedException ;
1112use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
1213use Magento \Framework \GraphQl \Config \Element \Field ;
@@ -45,10 +46,12 @@ public function resolve(
4546 if (!isset ($ value ['model ' ])) {
4647 throw new LocalizedException (__ ('"model" value should be specified ' ));
4748 }
48- /** @var Customer $customer */
49+ /** @var CustomerInterface $customer */
4950 $ customer = $ value ['model ' ];
51+ $ customerId = (int )$ customer ->getId ();
52+ $ websiteId = (int )$ customer ->getWebsiteId ();
53+ $ status = $ this ->subscriberFactory ->create ()->loadByCustomer ($ customerId , $ websiteId )->isSubscribed ();
5054
51- $ status = $ this ->subscriberFactory ->create ()->loadByCustomerId ((int )$ customer ->getId ())->isSubscribed ();
5255 return (bool )$ status ;
5356 }
5457}
You can’t perform that action at this time.
0 commit comments