Skip to content

Commit

Permalink
feat/Add form submission handling: Log payload to console on save
Browse files Browse the repository at this point in the history
  • Loading branch information
IraBoh committed Nov 19, 2024
1 parent 9a4683a commit 0258bfc
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,22 @@ export function EnvironmentVariableForm() {
}
};

const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();

const validItems = items.filter(item =>
item.key.trim() !== "" || item.value.trim() !== ""
);

console.log("Saved Environment Variables", validItems.map(item => ({
key: item.key,
value: item.value
})))
};

return (
<div className="w-full">
<Form method="post" className="w-full">
<Form method="post" className="w-full" onSubmit={handleSubmit}>
<div className="bg-background shadow-sm rounded-lg px-16 py-4 space-y-4">
<div className="rounded-md border">
<Table>
Expand Down

0 comments on commit 0258bfc

Please sign in to comment.