Преглед на файлове

Try It Out: Set query field booleans to 1 or 0

shalvah преди 4 години
родител
ревизия
5a1ad0340f
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      resources/views/components/field-details.blade.php

+ 2 - 2
resources/views/components/field-details.blade.php

@@ -23,8 +23,8 @@
     }
 @endphp
 @if($type === 'boolean')
-<label data-endpoint="{{ $endpointId }}" hidden><input type="radio" name="{{ $fullName }}" value="true" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" @if($required)required @endif><code>true</code></label>
-<label data-endpoint="{{ $endpointId }}" hidden><input type="radio" name="{{ $fullName }}" value="false" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" @if($required)required @endif><code>false</code></label>
+<label data-endpoint="{{ $endpointId }}" hidden><input type="radio" name="{{ $fullName }}" value="{{$component === 'body' ? 'true' : 1}}" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" @if($required)required @endif><code>true</code></label>
+<label data-endpoint="{{ $endpointId }}" hidden><input type="radio" name="{{ $fullName }}" value="{{$component === 'body' ? 'false' : 0}}" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" @if($required)required @endif><code>false</code></label>
 @elseif($isList)
 <input type="{{ $inputType }}" name="{{ $fullName.".0" }}" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" @if($required)required @endif hidden>
 <input type="{{ $inputType }}" name="{{ $fullName.".1" }}" data-endpoint="{{ $endpointId }}" data-component="{{ $component }}" hidden>