mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-20 08:08:58 +00:00
fix: save a cleared variable value instead of keeping the old one (#12466)
Updating a variable sent no value whenever the field was empty, so clearing a non-secret value (or a loaded secret) and clicking Update reported success but kept the stored value. Only skip the value when the baseline is empty too, which is the case of a secret never loaded.
This commit is contained in:
@@ -458,13 +458,10 @@
|
||||
path: ini.path,
|
||||
requestBody: {
|
||||
path: ini.path != s.path ? s.path : undefined,
|
||||
// An empty value keeps the stored one, except when it replaces a
|
||||
// reference: the reference is then dropped for the empty value.
|
||||
// An empty value keeps the stored one only while the baseline is empty too
|
||||
// (a secret never loaded): clearing a value or reference that was shown saves it empty.
|
||||
value:
|
||||
s.variable.value == '' &&
|
||||
!(isExternalRef(ini.variable.value) && !isExternalRef(s.variable.value))
|
||||
? undefined
|
||||
: s.variable.value,
|
||||
s.variable.value == '' && ini.variable.value == '' ? undefined : s.variable.value,
|
||||
is_secret:
|
||||
ini.variable.is_secret != s.variable.is_secret ? s.variable.is_secret : undefined,
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user