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 7
7
8
8
namespace Magento \CustomerGraphQl \Model \Resolver ;
9
9
10
+ use Magento \Customer \Api \Data \CustomerInterface ;
10
11
use Magento \Framework \Exception \LocalizedException ;
11
12
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
12
13
use Magento \Framework \GraphQl \Config \Element \Field ;
@@ -45,10 +46,12 @@ public function resolve(
45
46
if (!isset ($ value ['model ' ])) {
46
47
throw new LocalizedException (__ ('"model" value should be specified ' ));
47
48
}
48
- /** @var Customer $customer */
49
+ /** @var CustomerInterface $customer */
49
50
$ customer = $ value ['model ' ];
51
+ $ customerId = (int )$ customer ->getId ();
52
+ $ websiteId = (int )$ customer ->getWebsiteId ();
53
+ $ status = $ this ->subscriberFactory ->create ()->loadByCustomer ($ customerId , $ websiteId )->isSubscribed ();
50
54
51
- $ status = $ this ->subscriberFactory ->create ()->loadByCustomerId ((int )$ customer ->getId ())->isSubscribed ();
52
55
return (bool )$ status ;
53
56
}
54
57
}
You can’t perform that action at this time.
0 commit comments