Move the primary allocation when it is removed from a server
This commit is contained in:
1 parent
72779c7ea6
commit
ddaef93768
6 files changed
+82
-4
No files matched your search
@@ -139,6 +139,10 @@ class NetworkAllocationController extends ClientApiController
|
||||
|
||||
Allocation::query()->where('id', $allocation->id)->update(Allocation::RELEASE_ATTRIBUTES);
|
||||
|
||||
if ($allocation->id === $server->allocation_id) {
|
||||
$server->update(['allocation_id' => $server->allocations()->first()?->id]);
|
||||
}
|
||||
|
||||
Activity::event('server:allocation.delete')
|
||||
->subject($allocation)
|
||||
->property('allocation', $allocation->address)
|
||||
|
||||
Reference in new issue
Block a user