Skip to content

Commit 33d8148

Browse files
committed
[Customer] Rename dob to date_of_birth #911
1 parent d167013 commit 33d8148

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function execute(CustomerInterface $customer): array
105105
$customerData['group_id'] = null;
106106
$customerData['model'] = $customer;
107107
$customerData['id'] = null;
108-
108+
$customerData['date_of_birth'] = $customerData['dob'];
109109
return $customerData;
110110
}
111111
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ public function resolve(
7070
if (!$this->newsLetterConfig->isActive(ScopeInterface::SCOPE_STORE)) {
7171
$args['input']['is_subscribed'] = false;
7272
}
73-
73+
if (isset($args['input']['date_of_birth'])) {
74+
$args['input']['dob'] = $args['input']['date_of_birth'];
75+
}
7476
$customer = $this->createCustomerAccount->execute(
7577
$args['input'],
7678
$context->getExtensionAttributes()->getStore()

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function resolve(
7070
if (empty($args['input']) || !is_array($args['input'])) {
7171
throw new GraphQlInputException(__('"input" value should be specified'));
7272
}
73+
if (isset($args['input']['date_of_birth'])) {
74+
$args['input']['dob'] = $args['input']['date_of_birth'];
75+
}
7376

7477
$customer = $this->getCustomer->execute($context);
7578
$this->updateCustomerAccount->execute(

0 commit comments

Comments
 (0)