From d48dddef91200da5710fc0d878de058159166024 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Fri, 12 Jul 2024 17:24:47 +0200 Subject: [PATCH] fix(Actions/modify): Open the correct modification procedure In the case of licenses and identity cards today, there is a foreign version. The StepperDialogProvider handles this very well, as long as you enter the correct search params. --- src/components/Actions/Items/modify.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Actions/Items/modify.jsx b/src/components/Actions/Items/modify.jsx index 6d740f4b..13c0b40b 100644 --- a/src/components/Actions/Items/modify.jsx +++ b/src/components/Actions/Items/modify.jsx @@ -21,7 +21,11 @@ export const modify = ({ t, navigate }) => { !isFromKonnector(docs[0]) && getCreatedByApp(docs[0]) === 'mespapiers', action: docs => { - navigate(`edit/${docs[0]._id}`) + const country = docs[0].metadata.country?.toLowerCase() + navigate({ + pathname: `edit/${docs[0]._id}`, + ...(country && { search: `?country=${country}` }) + }) }, // eslint-disable-next-line react/display-name Component: forwardRef((props, ref) => {