浏览代码

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>