Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
helloanoop authored Nov 30, 2024
1 parent b9931ee commit b9230ad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CreateEnvironment = ({ collection, onClose }) => {

// todo: Add this to global env too.
const validateEnvironmentName = (name) => {
return !collection.environments.some((env) => env?.name?.toLowerCase() === name?.toLowerCase().trim());
return !collection.environments.some((env) => env?.name?.toLowerCase().trim() === name?.toLowerCase().trim());
};

const formik = useFormik({
Expand All @@ -26,7 +26,7 @@ const CreateEnvironment = ({ collection, onClose }) => {
.min(1, 'Must be at least 1 character')
.max(50, 'Must be 50 characters or less')
.required('Name is required')
.test('duplicate-name', 'Environment name already exists', validateEnvironmentName)
.test('duplicate-name', 'Environment already exists', validateEnvironmentName)
}),
onSubmit: (values) => {
dispatch(addEnvironment(values.name, collection.uid))
Expand Down

0 comments on commit b9230ad

Please sign in to comment.