fixed redirect on cancel (#28598)

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>
Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2024-04-10 16:36:01 +01:00 committed by GitHub
parent cccddc0810
commit adc8d388dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,9 +15,7 @@ import { FormProvider, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link, useMatch, useNavigate } from "react-router-dom"; import { Link, useMatch, useNavigate } from "react-router-dom";
import { TextControl } from "ui-shared"; import { TextControl } from "ui-shared";
import { adminClient } from "../../admin-client"; import { adminClient } from "../../admin-client";
import { toClient } from "../../clients/routes/Client";
import { useAlerts } from "../../components/alert/Alerts"; import { useAlerts } from "../../components/alert/Alerts";
import { useConfirmDialog } from "../../components/confirm-dialog/ConfirmDialog"; import { useConfirmDialog } from "../../components/confirm-dialog/ConfirmDialog";
import { DynamicComponents } from "../../components/dynamic/DynamicComponents"; import { DynamicComponents } from "../../components/dynamic/DynamicComponents";
@ -30,6 +28,7 @@ import { useFetch } from "../../utils/useFetch";
import { useParams } from "../../utils/useParams"; import { useParams } from "../../utils/useParams";
import { toClientScope } from "../routes/ClientScope"; import { toClientScope } from "../routes/ClientScope";
import { MapperParams, MapperRoute } from "../routes/Mapper"; import { MapperParams, MapperRoute } from "../routes/Mapper";
import { toDedicatedScope } from "../../clients/routes/DedicatedScopeDetails";
export default function MappingDetails() { export default function MappingDetails() {
const { t } = useTranslation(); const { t } = useTranslation();
@ -54,7 +53,7 @@ export default function MappingDetails() {
const toDetails = () => const toDetails = () =>
isOnClientScope isOnClientScope
? toClientScope({ realm, id, tab: "mappers" }) ? toClientScope({ realm, id, tab: "mappers" })
: toClient({ realm, clientId: id, tab: "mappers" }); : toDedicatedScope({ realm, clientId: id, tab: "mappers" });
useFetch( useFetch(
async () => { async () => {