Fix assigning default when system has more than 1 AKA in different zones

This commit is contained in:
Deon George 2021-08-15 17:26:01 +10:00
parent 988d4dda52
commit 0789ee9042
2 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class ZoneController extends Controller
$default = $o->systems->where('pivot.default',TRUE);
if ($default->first()->addresses->pluck('role')->search(DomainController::NODE_ZC) !== FALSE)
if ($default->count() && $default->first()->addresses->pluck('role')->search(DomainController::NODE_ZC) !== FALSE)
abort(412);
if ($default->count() && ($default->first()->id != $request->sid))

View File

@ -65,7 +65,7 @@ use App\Http\Controllers\DomainController as DC;
@if(($x=$oo->systems->where('pivot.default',TRUE))->count() && ($x->first()->id !== $o->id))
<i class="bi bi-dash-square"></i>
@else
<span id="default" itemid="{{$oo->id}}"><i class="bi bi-{{ $x->count() ? 'check-square' : 'square' }}"></i></span>
<span class="default" itemid="{{$oo->id}}"><i class="bi bi-{{ $x->count() ? 'check-square' : 'square' }}"></i></span>
@endif
</td>
<td>{{ $oo->pivot->sespass }}</td>
@ -288,7 +288,7 @@ use App\Http\Controllers\DomainController as DC;
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#default').click(function() {
$('.default').click(function() {
var item = this;
icon = $(item).find('i');