Skip to content

Commit

Permalink
fix(account): Fix account import
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jun 1, 2024
1 parent 8a13936 commit bc65e6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Module/Api/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,17 @@ public function saveMultiple(
foreach ($accounts as $i => $account) {
$id = $account->getId();

$current = $orm->findOne(Account::class, $id);
$current = null;

if ($id) {
$current = $orm->findOne(Account::class, $id);
}

if ($current) {
if ((string) $current->getUserId() !== (string) $currentUser->getId()) {
continue;
}

$orm->updateOne(Account::class, $account);
} else {
$accountService->validateUserNotExceedAccountLimit($currentUser);
Expand Down

0 comments on commit bc65e6a

Please sign in to comment.