Validation fix when creating a new host

This commit is contained in:
Deon George 2021-07-18 23:38:18 +10:00
parent 5ad342fd56
commit a37da4b099

View File

@ -82,6 +82,7 @@ class SystemController extends Controller
function ($attribute,$value,$fail) use ($request) {
// Check that the region doesnt already exist
$o = Address::where(function($query) use ($value) {
return $query->where(function($query) use ($value) {
return $query->where('region_id',$value)
->where('role',DomainController::NODE_RC);
})
@ -89,6 +90,7 @@ class SystemController extends Controller
->orWhere(function($query) use ($value) {
return $query->where('host_id',$value)
->where('role',DomainController::NODE_NC);
});
})
->where('zone_id',$request->post('zone_id'))
->where('point_id',0)