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,
|
2023-10-02 14:25:46 +02: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
|
|
|
|
2024-01-12 10:25:59 +01:00
|
|
|
let queryString: string | undefined;
|
2021-10-20 13:12:48 +02:00
|
|
|
if (query) {
|
|
|
|
queryString = Object.keys(query).reduce((acc, curr) => {
|
2023-10-02 14:25:46 +02:00
|
|
|
return `${acc}${curr}=${query[curr]}`;
|
2021-10-20 13:12:48 +02:00
|
|
|
}, '');
|
|
|
|
}
|
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
|
|
|
};
|
|
|
|
|
2023-08-21 12:55:04 +02:00
|
|
|
export const getProjectEditPath = (projectId: string) => {
|
|
|
|
return `/projects/${projectId}/settings`;
|
2021-08-25 13:37:22 +02:00
|
|
|
};
|