add query params back into admin redirect url w/ burnettk

This commit is contained in:
jasquat 2024-04-17 10:43:15 -04:00
parent 618945ce61
commit ebd5c60758
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,9 @@ import { useNavigate } from 'react-router-dom';
export default function AdminRedirect() {
const navigate = useNavigate();
useEffect(() => {
const newPath = window.location.pathname.replace(/^\/admin\//, '/');
let newPath = window.location.pathname.replace(/^\/admin\//, '/');
const queryParams = window.location.search;
newPath = `${newPath}${queryParams}`;
navigate(newPath);
}, [navigate]);