feat: add endpoint to retrieve selected bank account for a tenant and update routes with authentication
This commit is contained in:
@@ -64,4 +64,13 @@ class BankAccountController extends Controller
|
||||
|
||||
return TenantResource::make($tenant->loadMissing(['headerLogo', 'footerLogo', 'selectedBankAccount']));
|
||||
}
|
||||
|
||||
public function selected(Tenant $tenant): JsonResponse
|
||||
{
|
||||
$account = $tenant->selectedBankAccount;
|
||||
|
||||
abort_if(!$account, 404, 'No bank account is currently selected for this tenant.');
|
||||
|
||||
return BankAccountResource::make($account)->response();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user