Skip to content

Commit

Permalink
added cast number value to float if value is string (#830)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Televich <[email protected]>
  • Loading branch information
ptelevich and Pavel Televich authored Mar 26, 2024
1 parent 88b6c67 commit 84e49b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/js/tryitout.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ async function executeTryOut(endpointId, form) {
const bodyParameters = form.querySelectorAll('input[data-component=body]');
bodyParameters.forEach(el => {
let value = el.value;

if (el.type === 'number' && typeof value === 'string') {
value = parseFloat(value);
}

if (el.type === 'file' && el.files[0]) {
setter(el.name, el.files[0]);
return;
Expand Down

0 comments on commit 84e49b5

Please sign in to comment.