Streamline adding params to app routes

This commit is contained in:
schroda
2025-05-21 01:55:32 +02:00
parent 7ae7c3e768
commit f6b4ed8f56
5 changed files with 26 additions and 22 deletions

View File

@@ -157,7 +157,7 @@ export const MangaActionMenuItems = ({
)}
{isSingleMode && (
<Link
to={`${AppRoutes.migrate.childRoutes.search.path(manga?.sourceId ?? -1, manga?.id ?? -1)}?query=${manga?.title}`}
to={AppRoutes.migrate.childRoutes.search.path(manga?.sourceId ?? -1, manga?.id ?? -1, manga?.title)}
state={{ mangaTitle: manga?.title }}
style={{ textDecoration: 'none', color: 'inherit' }}
>

View File

@@ -66,7 +66,11 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
<>
<CustomTooltip title={t('global.button.migrate')}>
<Link
to={`${AppRoutes.migrate.childRoutes.search.path(manga.sourceId, manga.id)}?query=${manga.title}`}
to={AppRoutes.migrate.childRoutes.search.path(
manga.sourceId,
manga.id,
manga.title,
)}
state={{ mangaTitle: manga.title }}
style={{ textDecoration: 'none', color: 'inherit' }}
>
@@ -126,7 +130,7 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
<MenuItem
key="migrate"
component={Link}
to={`${AppRoutes.migrate.childRoutes.search.path(manga.sourceId, manga.id)}?query=${manga.title}`}
to={AppRoutes.migrate.childRoutes.search.path(manga.sourceId, manga.id, manga.title)}
state={{ mangaTitle: manga.title }}
style={{ textDecoration: 'none', color: 'inherit' }}
>

View File

@@ -34,7 +34,7 @@ const getMangaLinkTo = (
case 'duplicate':
return AppRoutes.manga.path(mangaId);
case 'migrate.search':
return `${AppRoutes.migrate.childRoutes.search.path(sourceId ?? '-1', mangaId)}?query=${mangaTitle}`;
return AppRoutes.migrate.childRoutes.search.path(sourceId ?? '-1', mangaId, mangaTitle);
case 'migrate.select':
return '';
default: