mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Add test coverage for allocation assignment endpoint
This commit is contained in:
@@ -122,6 +122,12 @@ class NetworkAllocationController extends ClientApiController
|
||||
*/
|
||||
public function store(NewAllocationRequest $request, Server $server): array
|
||||
{
|
||||
if ($server->allocations()->count() >= $server->allocation_limit) {
|
||||
throw new DisplayException(
|
||||
'Cannot assign additional allocations to this server: limit has been reached.'
|
||||
);
|
||||
}
|
||||
|
||||
$allocation = $this->assignableAllocationService->handle($server);
|
||||
|
||||
return $this->fractal->item($allocation)
|
||||
|
||||
Reference in New Issue
Block a user