2022-02-04 10:36:08 +01:00
|
|
|
export const getTogglePath = (projectId: string, featureToggleName: string) => {
|
|
|
|
return `/projects/${projectId}/features/${featureToggleName}`;
|
2021-08-25 13:37:22 +02:00
|
|
|
};
|
|
|
|
|
2021-10-20 13:12:48 +02:00
|
|
|
export const getCreateTogglePath = (
|
|
|
|
projectId: string,
|
|
|
|
newPath: boolean = false,
|
2022-02-25 10:55:39 +01:00
|
|
|
query?: Record<string, string>
|
2021-10-20 13:12:48 +02:00
|
|
|
) => {
|
2022-01-10 13:04:49 +01:00
|
|
|
const path = `/projects/${projectId}/create-toggle`;
|
2021-10-20 13:12:48 +02:00
|
|
|
|
|
|
|
let queryString;
|
|
|
|
if (query) {
|
|
|
|
queryString = Object.keys(query).reduce((acc, curr) => {
|
|
|
|
acc += `${curr}=${query[curr]}`;
|
|
|
|
return acc;
|
|
|
|
}, '');
|
|
|
|
}
|
2022-02-25 10:55:39 +01:00
|
|
|
|
2021-10-20 13:12:48 +02:00
|
|
|
if (queryString) {
|
|
|
|
return `${path}?${queryString}`;
|
|
|
|
}
|
2022-02-25 10:55:39 +01:00
|
|
|
|
2021-10-20 13:12:48 +02:00
|
|
|
return path;
|
2021-08-25 13:37:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const getProjectEditPath = (projectId: string) => {
|
|
|
|
return `/projects/${projectId}/edit`;
|
|
|
|
};
|