Skip to content

Commit

Permalink
[Customer] Rename dob to date_of_birth #911
Browse files Browse the repository at this point in the history
  • Loading branch information
XxXgeoXxX committed Sep 27, 2019
1 parent d167013 commit 33d8148
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function execute(CustomerInterface $customer): array
$customerData['group_id'] = null;
$customerData['model'] = $customer;
$customerData['id'] = null;

$customerData['date_of_birth'] = $customerData['dob'];
return $customerData;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public function resolve(
if (!$this->newsLetterConfig->isActive(ScopeInterface::SCOPE_STORE)) {
$args['input']['is_subscribed'] = false;
}

if (isset($args['input']['date_of_birth'])) {
$args['input']['dob'] = $args['input']['date_of_birth'];
}
$customer = $this->createCustomerAccount->execute(
$args['input'],
$context->getExtensionAttributes()->getStore()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public function resolve(
if (empty($args['input']) || !is_array($args['input'])) {
throw new GraphQlInputException(__('"input" value should be specified'));
}
if (isset($args['input']['date_of_birth'])) {
$args['input']['dob'] = $args['input']['date_of_birth'];
}

$customer = $this->getCustomer->execute($context);
$this->updateCustomerAccount->execute(
Expand Down

0 comments on commit 33d8148

Please sign in to comment.