Explorar el Código

Merge branch 'master' into v4

shalvah hace 2 años
padre
commit
5ae4c14390
Se han modificado 1 ficheros con 5 adiciones y 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);
         }
     });