2021-10-01 19:38:34 +02:00
|
|
|
export const getTogglePath = (projectId: string, featureToggleName: string, newPath: boolean) => {
|
2021-10-15 09:39:37 +02:00
|
|
|
return `/projects/${projectId}/features${newPath ? `2/${featureToggleName}` : `/${featureToggleName}/strategies`}`;
|
2021-08-25 13:37:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const getToggleCopyPath = (
|
|
|
|
projectId: string,
|
|
|
|
featureToggleName: string
|
|
|
|
) => {
|
|
|
|
return `/projects/${projectId}/features/${featureToggleName}/strategies/copy`;
|
|
|
|
};
|
|
|
|
|
2021-10-20 13:12:48 +02:00
|
|
|
export const getCreateTogglePath = (
|
|
|
|
projectId: string,
|
|
|
|
newPath: boolean = false,
|
|
|
|
query?: Object
|
|
|
|
) => {
|
|
|
|
const path = newPath
|
|
|
|
? `/projects/${projectId}/create-toggle2`
|
|
|
|
: `/projects/${projectId}/create-toggle`;
|
|
|
|
|
|
|
|
let queryString;
|
|
|
|
if (query) {
|
|
|
|
queryString = Object.keys(query).reduce((acc, curr) => {
|
|
|
|
acc += `${curr}=${query[curr]}`;
|
|
|
|
return acc;
|
|
|
|
}, '');
|
|
|
|
}
|
|
|
|
if (queryString) {
|
|
|
|
return `${path}?${queryString}`;
|
|
|
|
}
|
|
|
|
return path;
|
2021-08-25 13:37:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const getProjectEditPath = (projectId: string) => {
|
|
|
|
return `/projects/${projectId}/edit`;
|
|
|
|
};
|