Skip to content

Commit

Permalink
clean up unused
Browse files Browse the repository at this point in the history
  • Loading branch information
lovincyrus committed Dec 11, 2024
1 parent 0fc02d9 commit 96a18c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
});
let duplicateCount = 0;
existingKeys.forEach((key, idx) => {
existingKeys.forEach((key, _idx) => {
const variableEnvironment = key.environment;
const variableKey = key.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,40 +78,32 @@
}),
);
const {
form,
enhance,
formId,
submit,
errors,
allErrors,
submitting,
reset: formReset,
} = superForm(defaults(initialValues, schema), {
id: id,
SPA: true,
validators: schema,
resetForm: false,
async onUpdate({ form }) {
if (!form.valid) return;
const values = form.data;
checkForExistingKeys();
if (isKeyAlreadyExists) return;
const flatVariable = {
[values.key]: values.value,
};
try {
await handleUpdateProjectVariables(flatVariable);
open = false;
handleReset();
} catch (error) {
console.error(error);
}
},
});
const { form, enhance, formId, submit, errors, allErrors, submitting } =
superForm(defaults(initialValues, schema), {
id: id,
SPA: true,
validators: schema,
resetForm: false,
async onUpdate({ form }) {
if (!form.valid) return;
const values = form.data;
checkForExistingKeys();
if (isKeyAlreadyExists) return;
const flatVariable = {
[values.key]: values.value,
};
try {
await handleUpdateProjectVariables(flatVariable);
open = false;
handleReset();
} catch (error) {
console.error(error);
}
},
});
async function handleUpdateProjectVariables(
flatVariable: AdminServiceUpdateProjectVariablesBodyVariables,
Expand Down

0 comments on commit 96a18c4

Please sign in to comment.