mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
4a4dafcc3f
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.
24 lines
599 B
TypeScript
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;
|
|
};
|