This commit is contained in:
2025-01-24 11:57:44 +01:00
parent 16b5522ff5
commit bdb807d3e0
3 changed files with 18 additions and 9 deletions

View File

@@ -27,11 +27,20 @@ const selectedFunction = () => {
}
if (selectOption(selectedOption.value) === 'Remove Param') {
const currentIndex = options.value.indexOf(selectedOption.value)
options.value.splice(currentIndex, 1);
selectedOption.value= options.value[0].name
valueInput.value = ""
nameInput.value = ""
const foundOption = options.value.find(option => option.name === selectedOption.value);
if (foundOption) {
const currentIndex = options.value.indexOf(foundOption);
if (currentIndex !== -1) {
options.value.splice(currentIndex, 1);
}
}
if (options.value.length > 0) {
selectedOption.value = options.value[0].name;
} else {
selectedOption.value = "";
}
valueInput.value = "";
nameInput.value = "";
}
sendToParent()
/*

View File

@@ -63,7 +63,7 @@ function readFile(file: any) {
const handleUpdateValue = (options: { name: string }[]) => {
console.log("from parent" +options.length)
params.value = options
updateParams(params)
updateParams(params.value)
};
</script>

View File

@@ -127,10 +127,10 @@ function selectRequestBodyType() : string {
return prepareRequestBodySingleXml(props.xml!);
}
function formatParams() {
return props.params.map(param => {
return props.params?.slice(1).map(param => {
const [key, value] = param.name.split(" = ");
return {key, value};
});
return { key, value };
}) ?? [];
}
function prepareRequestBodySingleXml(data: string):string {