diff --git a/src/enums/appEnum.ts b/src/enums/appEnum.ts index 2de4c43d..bdd1d25b 100644 --- a/src/enums/appEnum.ts +++ b/src/enums/appEnum.ts @@ -13,3 +13,9 @@ export enum ProviderCategory { OAuth = 'OAuth', Generic = 'Generic', } + +export enum PolicyType { + CUSTOM = 'CUSTOM', + SYSTEM = 'CUSTOM', + DEFAULT = 'DEFAULT', +} diff --git a/src/pages/Policy/Create/_hooks.ts b/src/pages/Policy/Create/_hooks.ts index b0fbccd6..2e669e9f 100644 --- a/src/pages/Policy/Create/_hooks.ts +++ b/src/pages/Policy/Create/_hooks.ts @@ -6,6 +6,7 @@ import { updatePolicy, UpdatePolicyRequest } from '@/services/policy/updatePolic import { getPolicyInfo } from '@/services/policy/getPolicyInfo'; import { listResources } from '@/services/resource/listResources'; import { App } from 'antd'; +import { PolicyType } from '@/enums'; const INTL = { CREATE_SUCCESS: { @@ -182,7 +183,7 @@ export default function usePolicyHook() { let policy = { name: values.name, description: values.description, - type: values.type, + type: values.type ? values.type : PolicyType.CUSTOM, subjects: values.subjects, status: '0', statements: values.statements?.map((item) => {