1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Splitting url params to pass in catalogURL()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-09-28 08:08:53 +03:00
parent 5f5b1efadb
commit b5e8ef1659

View File

@ -31,7 +31,14 @@ export const catalogRoute: RouteProps = {
};
export const getPreviousTabUrl = (path: string) => {
return `${catalogURL()}/${path || browseCatalogTab}`;
const [group, kind] = path.split("/");
return catalogURL({
params: {
group: group || browseCatalogTab,
kind
}
});
};
export const catalogURL = buildURL<CatalogViewRouteParam>(catalogRoute.path);