fix: request variable list item remove bug (#4392)

This commit is contained in:
Nivedin
2024-10-01 14:12:29 +05:30
committed by GitHub
parent dcdcdeb1db
commit 1a7860035f
4 changed files with 15 additions and 35 deletions

View File

@@ -251,6 +251,21 @@ const workingRequestVariables = ref<
},
])
// Rule: Working Request variable always have last element is always an empty param
watch(workingRequestVariables, (variableList) => {
if (
variableList.length > 0 &&
variableList[variableList.length - 1].key !== ""
) {
workingRequestVariables.value.push({
id: idTicker.value++,
key: "",
value: "",
active: true,
})
}
})
// Sync logic between params and working/bulk params
watch(
requestVariables,
@@ -324,21 +339,6 @@ watch(bulkVariables, (newBulkParams) => {
}
})
// Rule: Working Request variable always have last element is always an empty param
watch(workingRequestVariables, (variableList) => {
if (
variableList.length > 0 &&
variableList[variableList.length - 1].key !== ""
) {
workingRequestVariables.value.push({
id: idTicker.value++,
key: "",
value: "",
active: true,
})
}
})
const addVariable = () => {
workingRequestVariables.value.push({
id: idTicker.value++,