fix: request variable list item remove bug (#4392)
This commit is contained in:
@@ -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++,
|
||||
|
||||
Reference in New Issue
Block a user