refactor(admin-panel): standardize FeatureFlagKey usage (#9548)
Replaced string-based feature flag keys with the typed FeatureFlagKey enum across the admin panel module and related front-end hooks. This ensures stronger type safety, reduces potential errors, and improves consistency in handling feature flags.
This commit is contained in:
@ -4,6 +4,7 @@ import { isDefined } from 'twenty-ui';
|
||||
import {
|
||||
useUpdateWorkspaceFeatureFlagMutation,
|
||||
useUserLookupAdminPanelMutation,
|
||||
FeatureFlagKey,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
export const useFeatureFlagsManagement = () => {
|
||||
@ -42,7 +43,7 @@ export const useFeatureFlagsManagement = () => {
|
||||
|
||||
const handleFeatureFlagUpdate = async (
|
||||
workspaceId: string,
|
||||
featureFlag: string,
|
||||
featureFlag: FeatureFlagKey,
|
||||
value: boolean,
|
||||
) => {
|
||||
setError(null);
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export type FeatureFlag = {
|
||||
key: string;
|
||||
key: FeatureFlagKey;
|
||||
value: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user