Fix deletion of route (#4466)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
kodiakhq[bot]
parent
8b69359ccb
commit
45059554b6
@@ -193,17 +193,10 @@ const Route = ({
|
||||
label={route.isFallback ? "Fallback Route" : `Route ${index + 1}`}
|
||||
deleteField={{
|
||||
check: () => routes.length !== 1 && !route.isFallback,
|
||||
fn: () => (
|
||||
<button className="ml-5" type="button">
|
||||
<Icon.FiTrash
|
||||
className="m-0 h-4 w-4 text-neutral-500"
|
||||
onClick={() => {
|
||||
const newRoutes = routes.filter((r) => r.id !== route.id);
|
||||
setRoutes(newRoutes);
|
||||
}}
|
||||
/>
|
||||
</button>
|
||||
),
|
||||
fn: () => {
|
||||
const newRoutes = routes.filter((r) => r.id !== route.id);
|
||||
setRoutes(newRoutes);
|
||||
},
|
||||
}}>
|
||||
<div className="-mx-4 mb-4 flex w-full items-center sm:mx-0">
|
||||
<div className="cal-query-builder w-full ">
|
||||
|
||||
@@ -46,6 +46,7 @@ export default function FormCard({
|
||||
<span className="text-sm font-semibold leading-none">{label}</span>
|
||||
{deleteField?.check() ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
deleteField?.fn();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user