Skip to content

Commit

Permalink
fix: 默认 policy type
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-hui committed Oct 22, 2023
1 parent ead44b1 commit 80e2745
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/enums/appEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ export enum ProviderCategory {
OAuth = 'OAuth',
Generic = 'Generic',
}

export enum PolicyType {
CUSTOM = 'CUSTOM',
SYSTEM = 'CUSTOM',
DEFAULT = 'DEFAULT',
}
3 changes: 2 additions & 1 deletion src/pages/Policy/Create/_hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 80e2745

Please sign in to comment.