Explorar o código

Merge branch 'master' into v4

shalvah %!s(int64=2) %!d(string=hai) anos
pai
achega
5ae4c14390
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      resources/js/tryitout.js

+ 5 - 0
resources/js/tryitout.js

@@ -219,6 +219,11 @@ async function executeTryOut(endpointId, form) {
     const queryParameters = form.querySelectorAll('input[data-component=query]');
     queryParameters.forEach(el => {
         if (el.type !== 'radio' || (el.type === 'radio' && el.checked)) {
+            if (el.value === '' && el.required === false) {
+                // Don't include empty optional values in the request
+                return;
+            }
+
             _.set(query, el.name, el.value);
         }
     });