Skip to content

Commit

Permalink
fixed to update customer password
Browse files Browse the repository at this point in the history
fixed password when create customer

fixed password when create customer
  • Loading branch information
Edward Yang committed Dec 18, 2024
1 parent 563c178 commit 887c51a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion innopacks/common/src/Repositories/CustomerRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public function builder(array $filters = []): Builder
public function create($data): Customer
{
$data = $this->handleData($data);
if (! isset($data['password'])) {
$data['password'] = '';
}
$item = new Customer($data);
$item->saveOrFail();

Expand Down Expand Up @@ -205,7 +208,6 @@ private function handleData(array $requestData): array
{
$data = [
'email' => $requestData['email'],
'password' => '',
'name' => $requestData['name'],
'customer_group_id' => $requestData['customer_group_id'] ?? 0,
'address_id' => $requestData['address_id'] ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion innopacks/common/src/Resources/CustomerGroupSimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->translation->name,
'name' => $this->translation->name ?? '',
];
}
}

0 comments on commit 887c51a

Please sign in to comment.