fix: navigation issues (#20565)

This commit is contained in:
Rémi de Juvigny 2024-06-20 14:35:59 +02:00 committed by GitHub
parent c89af5f4e3
commit bbdc5e8aa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -150,7 +150,7 @@ const CreatePage = () => {
message: formatMessage({ id: 'Settings.roles.created', defaultMessage: 'created' }), message: formatMessage({ id: 'Settings.roles.created', defaultMessage: 'created' }),
}); });
navigate(res.data.id.toString(), { replace: true }); navigate(`../roles/${res.data.id.toString()}`, { replace: true });
} catch (err) { } catch (err) {
toggleNotification({ toggleNotification({
type: 'danger', type: 'danger',

View File

@ -721,10 +721,13 @@ const UpdateAction: DocumentActionComponent = ({
/** /**
* TODO: refactor the router so we can just do `../${res.data.documentId}` instead of this. * TODO: refactor the router so we can just do `../${res.data.documentId}` instead of this.
*/ */
navigate({ navigate(
pathname: `../${collectionType}/${model}/${res.data.documentId}`, {
search: rawQuery, pathname: `../${collectionType}/${model}/${res.data.documentId}`,
}); search: rawQuery,
},
{ replace: true }
);
} else if ( } else if (
'error' in res && 'error' in res &&
isBaseQueryError(res.error) && isBaseQueryError(res.error) &&