Allow deletion of multiple allocations at once (#1322)

This commit is contained in:
Andrew DeLisa 2018-09-19 00:43:18 -04:00 committed by Dane Everitt
parent 053d7917ae
commit 262ef78fae
6 changed files with 164 additions and 7 deletions

View file

@ -285,6 +285,27 @@ class NodesController extends Controller
return response('', 204);
}
/**
* Removes multiple individual allocations from a node.
*
* @param \Illuminate\Http\Request $request
* @param int $node
* @return \Illuminate\Http\Response
*
* @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException
*/
public function allocationRemoveMultiple(Request $request, int $node): Response
{
$allocations = $request->input('allocations');
foreach ($allocations as $rawAllocation) {
$allocation = new Allocation();
$allocation->id = $rawAllocation['id'];
$this->allocationRemoveSingle($node, $allocation);
}
return response('', 204);
}
/**
* Remove all allocations for a specific IP at once on a node.
*