diff --git a/frontend/src/components/group/GroupCreateBox.tsx b/frontend/src/components/group/GroupCreateBox.tsx index 52cbfed..bc29a53 100644 --- a/frontend/src/components/group/GroupCreateBox.tsx +++ b/frontend/src/components/group/GroupCreateBox.tsx @@ -55,7 +55,7 @@ export function GroupCreateBox({viewSet, resource}: GroupCreateBoxProps): JSX.El const access = useFormState<"OPEN" | "MANUAL" | undefined>( resource?.value.access ?? undefined, - Validators.notEmpty, + Validators.mustBeDefined, ) const slug = diff --git a/frontend/src/components/project/ProjectCreateBox.tsx b/frontend/src/components/project/ProjectCreateBox.tsx index de935d8..c45661f 100644 --- a/frontend/src/components/project/ProjectCreateBox.tsx +++ b/frontend/src/components/project/ProjectCreateBox.tsx @@ -32,7 +32,7 @@ export function ProjectCreateBox({viewSet, resource}: ProjectCreateBoxProps): JS const visibility = useFormState<"PUBLIC" | "INTERNAL" | "PRIVATE" | undefined>( resource?.value.visibility ?? undefined, - Validators.notEmpty, + Validators.mustBeDefined, ) const slug = diff --git a/frontend/src/utils/Validators.ts b/frontend/src/utils/Validators.ts index 866d828..e086838 100644 --- a/frontend/src/utils/Validators.ts +++ b/frontend/src/utils/Validators.ts @@ -10,14 +10,14 @@ export class Validators { return true } - static notEmpty(val: T): Validity { + static mustBeDefined(val: T): Validity { if(!val) { return undefined } return true } - static notZeroLength(val: T): Validity { + static mustContainElements(val: T): Validity { if(!val) { return undefined } @@ -27,3 +27,4 @@ export class Validators { return true } } +