diff --git a/src/Module/Api/AccountController.php b/src/Module/Api/AccountController.php index 546a2cb..e06c672 100644 --- a/src/Module/Api/AccountController.php +++ b/src/Module/Api/AccountController.php @@ -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);