Expand API so you can also submit IBAN, BIC or number for new accounts

This commit is contained in:
James Cole
2019-10-13 11:50:04 +02:00
parent 79debe4941
commit 4ad601f29d
9 changed files with 116 additions and 38 deletions

View File

@@ -160,6 +160,10 @@ class BelongsUser implements Rule
*/
private function validateAccountId(int $value): bool
{
if (0 === $value) {
// its ok to submit 0. other checks will fail.
return true;
}
$count = Account::where('id', '=', $value)->where('user_id', '=', auth()->user()->id)->count();
return 1 === $count;