bugfix
This commit is contained in:
		| @@ -27,11 +27,20 @@ const selectedFunction = () => { | |||||||
|  |  | ||||||
|   } |   } | ||||||
|   if (selectOption(selectedOption.value) === 'Remove Param') { |   if (selectOption(selectedOption.value) === 'Remove Param') { | ||||||
|     const currentIndex = options.value.indexOf(selectedOption.value) |     const foundOption = options.value.find(option => option.name === selectedOption.value); | ||||||
|     options.value.splice(currentIndex, 1); |     if (foundOption) { | ||||||
|     selectedOption.value= options.value[0].name |       const currentIndex = options.value.indexOf(foundOption); | ||||||
|     valueInput.value = "" |       if (currentIndex !== -1) { | ||||||
|     nameInput.value = "" |         options.value.splice(currentIndex, 1); | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     if (options.value.length > 0) { | ||||||
|  |       selectedOption.value = options.value[0].name; | ||||||
|  |     } else { | ||||||
|  |       selectedOption.value = ""; | ||||||
|  |     } | ||||||
|  |     valueInput.value = ""; | ||||||
|  |     nameInput.value = ""; | ||||||
|   } |   } | ||||||
|   sendToParent() |   sendToParent() | ||||||
|   /* |   /* | ||||||
|   | |||||||
| @@ -63,7 +63,7 @@ function readFile(file: any) { | |||||||
| const handleUpdateValue = (options: { name: string }[]) => { | const handleUpdateValue = (options: { name: string }[]) => { | ||||||
|   console.log("from parent" +options.length) |   console.log("from parent" +options.length) | ||||||
|   params.value = options |   params.value = options | ||||||
|   updateParams(params) |   updateParams(params.value) | ||||||
| }; | }; | ||||||
|  |  | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -127,10 +127,10 @@ function selectRequestBodyType() : string { | |||||||
|         return prepareRequestBodySingleXml(props.xml!); |         return prepareRequestBodySingleXml(props.xml!); | ||||||
| } | } | ||||||
| function formatParams() { | function formatParams() { | ||||||
|   return props.params.map(param => { |   return props.params?.slice(1).map(param => { | ||||||
|     const [key, value] = param.name.split(" = "); |     const [key, value] = param.name.split(" = "); | ||||||
|     return {key, value}; |     return { key, value }; | ||||||
|   }); |   }) ?? []; | ||||||
| } | } | ||||||
|  |  | ||||||
| function prepareRequestBodySingleXml(data: string):string { | function prepareRequestBodySingleXml(data: string):string { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user