Skip to content

Commit

Permalink
Merge pull request #1500 from Spiteless/ts.1446
Browse files Browse the repository at this point in the history
feat: Update 'name' error message to be more clear
  • Loading branch information
trillium authored Sep 5, 2023
2 parents dbba2be + 7447e5f commit 6233447
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ const validateEventForm = (vals, projectToEdit) => {
newErrors = { ...newErrors, name: 'Event name is required' };
} else if (
isWordInArrayInString(
['meeting', 'mtg', projectToEdit.name.toLowerCase()],
['meeting', 'mtg'],
vals[key].toLowerCase()
)
) {
newErrors = {
...newErrors,
name: "Event name cannot contain 'meeting' or 'mtg' or the project name",
name: "Event name cannot contain 'meeting' or 'mtg'",
};
} else if (
isWordInArrayInString(
[projectToEdit.name.toLowerCase()],
vals[key].toLowerCase()
)
) {
newErrors = {
...newErrors,
name: `Event name cannot contain the Project Name: '${projectToEdit.name}'`,
};
}
break;
Expand Down

0 comments on commit 6233447

Please sign in to comment.