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