Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix empty value and comment issues on commit

Carlos Monastyrski4a6e4a90ee56
diff --git a/frontend/src/hooks/api/secrets/mutations.tsx b/frontend/src/hooks/api/secrets/mutations.tsx
index cfc1909959..11ebad4b13 100644
--- a/frontend/src/hooks/api/secrets/mutations.tsx
+++ b/frontend/src/hooks/api/secrets/mutations.tsx
@@ -463,8 +463,14 @@ export const useCreateCommit = () => {
.map((change: PendingSecretUpdate) => ({
secretKey: change.secretKey,
newSecretName: change.newSecretName,
- secretValue: change.secretValue || change.existingSecret.value,
- secretComment: change.secretComment || change.existingSecret.comment,
+ secretValue:
+ change.secretValue === ""
+ ? ""
+ : change.secretValue || change.existingSecret.value,
+ secretComment:
+ change.secretComment === ""
+ ? ""
+ : change.secretComment || change.existingSecret.comment,
skipMultilineEncoding:
change.skipMultilineEncoding !== undefined
? change.skipMultilineEncoding