fix: bad redirect in case of resistant not found
parent
8b09312f2d
commit
11800ee2be
|
@ -1,4 +1,4 @@
|
||||||
import { redirect, useNavigate, useParams } from "react-router";
|
import { useNavigate, useParams } from "react-router";
|
||||||
import { getResistantPhotoUrl } from "../getResistantPhotoUrl";
|
import { getResistantPhotoUrl } from "../getResistantPhotoUrl";
|
||||||
import { resistants } from "../resistants";
|
import { resistants } from "../resistants";
|
||||||
import { getResistantsPageUrl } from "../getResistantsPageUrl";
|
import { getResistantsPageUrl } from "../getResistantsPageUrl";
|
||||||
|
@ -10,7 +10,7 @@ export const PageResistant = () => {
|
||||||
const resistant = resistants.find((r) => r.id === idResistant);
|
const resistant = resistants.find((r) => r.id === idResistant);
|
||||||
|
|
||||||
if (!resistant) {
|
if (!resistant) {
|
||||||
redirect(getResistantsPageUrl());
|
window.location.assign(getResistantsPageUrl());
|
||||||
return <>Résistant introuvable</>;
|
return <>Résistant introuvable</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue