mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-05 10:13:17 +00:00
refactor(team): make server limit methods accept optional team parameter
Allow serverLimit() and serverLimitReached() to accept an optional team parameter instead of relying solely on the current session. This improves testability and makes the methods more flexible by allowing them to work without session state. Add comprehensive tests covering various scenarios including no session, team at limit, and team under limit.
This commit is contained in:
1 parent
8457e22863
commit
e37cb98c7c
3 files changed
+68
-7
No files matched your search
@@ -586,7 +586,8 @@ class HetznerController extends Controller
|
||||
}
|
||||
|
||||
// Check server limit
|
||||
if (Team::serverLimitReached()) {
|
||||
$team = Team::find($teamId);
|
||||
if (Team::serverLimitReached($team)) {
|
||||
return response()->json(['message' => 'Server limit reached for your subscription.'], 400);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user