1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/utils/routePathHelpers.ts
Jaanus Sellin 4a4dafcc3f
chore: remove create feature component (#7959)
After we implemented new feature flag creation flow, this are not used
anymore.

Creation is now handled by **CreateFeatureDialog**.

Also edit component can be minified, because it does not need so many
fields anymore.
2024-08-22 11:30:41 +03:00

24 lines
599 B
TypeScript

export const getTogglePath = (projectId: string, featureToggleName: string) => {
return `/projects/${projectId}/features/${featureToggleName}`;
};
export const getCreateTogglePath = (
projectId: string,
query?: Record<string, string>,
) => {
const path = `/projects/${projectId}?create=true`;
let queryString: string | undefined;
if (query) {
queryString = Object.keys(query).reduce((acc, curr) => {
return `${acc}${curr}=${query[curr]}`;
}, '');
}
if (queryString) {
return `${path}&${queryString}`;
}
return path;
};