mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-24 11:18:48 +02:00
🚸 redirect to list after update
This commit is contained in:
@@ -227,7 +227,9 @@ export default function RedirectForm({
|
|||||||
// Mirror is UI-only state; on edit, infer it from whether the saved
|
// Mirror is UI-only state; on edit, infer it from whether the saved
|
||||||
// destination already equals the source host.
|
// destination already equals the source host.
|
||||||
const [sameDomainAsSource, setSameDomainAsSource] = useState(
|
const [sameDomainAsSource, setSameDomainAsSource] = useState(
|
||||||
Boolean(redirect && sourceHost && redirect.destinationHost === sourceHost)
|
Boolean(
|
||||||
|
redirect && sourceHost && redirect.destinationHost === sourceHost
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -280,7 +282,6 @@ export default function RedirectForm({
|
|||||||
title: t("success"),
|
title: t("success"),
|
||||||
description: t("redirectUpdated")
|
description: t("redirectUpdated")
|
||||||
});
|
});
|
||||||
router.refresh();
|
|
||||||
} else {
|
} else {
|
||||||
const res = await api.put<
|
const res = await api.put<
|
||||||
AxiosResponse<CreateRedirectResponse>
|
AxiosResponse<CreateRedirectResponse>
|
||||||
@@ -289,8 +290,8 @@ export default function RedirectForm({
|
|||||||
title: t("success"),
|
title: t("success"),
|
||||||
description: t("redirectCreated")
|
description: t("redirectCreated")
|
||||||
});
|
});
|
||||||
router.push(`/${orgId}/settings/redirects/`);
|
|
||||||
}
|
}
|
||||||
|
router.push(`/${orgId}/settings/redirects/`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast({
|
toast({
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
|
|||||||
Reference in New Issue
Block a user