fix url and rm hack

This commit is contained in:
mfrances 2021-03-23 17:24:57 -04:00
parent f863f850d1
commit 2a7782fbae

View file

@ -27,7 +27,7 @@ import {
asyncStateFetch, asyncStateFetch,
} from "../../../context/auth/AdminClient"; } from "../../../context/auth/AdminClient";
import { useParams, Link } from "react-router-dom"; import { Link, useParams, useRouteMatch } from "react-router-dom";
interface ComponentMapperRepresentation { interface ComponentMapperRepresentation {
config?: Record<string, any>; config?: Record<string, any>;
@ -50,6 +50,8 @@ export const LdapMapperList = () => {
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { addAlert } = useAlerts(); const { addAlert } = useAlerts();
const { url } = useRouteMatch();
// const [mapperAction, setMapperAction] = useState(false); // const [mapperAction, setMapperAction] = useState(false);
const handleError = useErrorHandler(); const handleError = useErrorHandler();
@ -101,7 +103,6 @@ export const LdapMapperList = () => {
// .sort((a, b) => a.priority - b.priority) // .sort((a, b) => a.priority - b.priority)
); );
const url = "mappers";
const MapperLink = (mapper: ComponentMapperRepresentation) => ( const MapperLink = (mapper: ComponentMapperRepresentation) => (
<> <>
<Link to={`${url}/${mapper.id}`}>{mapper.name}</Link> <Link to={`${url}/${mapper.id}`}>{mapper.name}</Link>