Added params functionalities to multipleXml, bugfix
This commit is contained in:
@@ -23,7 +23,11 @@ const selectedOption = ref(options.value[0].name)
|
||||
|
||||
const selectedFunction = () => {
|
||||
if (selectOption(selectedOption.value) === 'Add Param') {
|
||||
options.value.push({name: nameInput.value + " = " + valueInput.value});
|
||||
if(!valueInput.value.length == 0 && !nameInput.value.length == 0){
|
||||
options.value.push({name: nameInput.value + " = " + valueInput.value});
|
||||
valueInput.value = "";
|
||||
nameInput.value = "";
|
||||
}
|
||||
|
||||
}
|
||||
if (selectOption(selectedOption.value) === 'Remove Param') {
|
||||
@@ -106,6 +110,22 @@ function selectOption(option: string): string {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<input
|
||||
v-if="selectedOption==='Add Param'"
|
||||
id="NameTextInput"
|
||||
v-model="nameInput"
|
||||
class="text-input h-full px-3 rounded-full border border-slate-400 bg-white dark:text-slate-100 dark:bg-gray-600 w-48"
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
/>
|
||||
<input
|
||||
v-if="selectedOption==='Add Param'"
|
||||
id="ValueTextInput"
|
||||
v-model="valueInput"
|
||||
class="text-input h-full px-3 rounded-full border border-slate-400 bg-white dark:text-slate-100 dark:bg-gray-600 w-48"
|
||||
type="text"
|
||||
placeholder="Value"
|
||||
/>
|
||||
<select
|
||||
v-model="selectedOption"
|
||||
class="flex h-full px-3 rounded-full border border-slate-400 bg-white dark:text-slate-100 dark:bg-gray-600 w-48"
|
||||
@@ -114,22 +134,7 @@ function selectOption(option: string): string {
|
||||
{{ option.name }}
|
||||
</option>
|
||||
</select>
|
||||
<input
|
||||
v-if="selectedOption==='Add Param'"
|
||||
id="NameTextInput"
|
||||
v-model="nameInput"
|
||||
class="text-input h-full px-3 rounded-full border border-slate-400 bg-white dark:text-slate-100 dark:bg-gray-600 w-1/3"
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
/>
|
||||
<input
|
||||
v-if="selectedOption==='Add Param'"
|
||||
id="ValueTextInput"
|
||||
v-model="valueInput"
|
||||
class="text-input h-full px-3 rounded-full border border-slate-400 bg-white dark:text-slate-100 dark:bg-gray-600 w-1/3"
|
||||
type="text"
|
||||
placeholder="Value"
|
||||
/>
|
||||
<button class="tool-button" @click="selectedFunction">{{ selectOption(selectedOption) }}</button>
|
||||
<button class="tool-button w-24" @click="selectedFunction">{{ selectOption(selectedOption) }}</button>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
@@ -149,12 +149,15 @@ function prepareRequestBodySingleXml(data: string):string {
|
||||
}
|
||||
|
||||
function prepareRequestBodyMultiXml():string {
|
||||
if (!Array.isArray(props.xml))
|
||||
const formattedParams = formatParams();
|
||||
|
||||
if (!Array.isArray(props.xml))
|
||||
return "";
|
||||
|
||||
let xmlFilesArray = convertDataArray(props.xml);
|
||||
|
||||
let requestBody = JSON.stringify({
|
||||
"params": formattedParams,
|
||||
"data": xmlFilesArray,
|
||||
"processorData": props.query,
|
||||
"processor": engine.value,
|
||||
|
||||
Reference in New Issue
Block a user