Skip to content

Commit

Permalink
Merge pull request #1504 from Spiteless/ts.1503
Browse files Browse the repository at this point in the history
feat: Whitelist 'onboarding' in event validation
  • Loading branch information
jbubar authored Sep 7, 2023
2 parents 44c794c + 1b65573 commit 5be05c0
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import validator from 'validator';
import { isWordInArrayInString } from './../../../utils/stringUtils.js';
import { el } from 'date-fns/locale';

const validateEventForm = (vals, projectToEdit) => {
let newErrors = {};
Expand All @@ -25,10 +26,14 @@ const validateEventForm = (vals, projectToEdit) => {
vals[key].toLowerCase()
)
) {
newErrors = {
...newErrors,
name: `Event name cannot contain the Project Name: '${projectToEdit.name}'`,
};
if (projectToEdit.name.toLowerCase() === 'onboarding') {
// Do nothing, word `onboarding` has been white-listed
} else {
newErrors = {
...newErrors,
name: `Event name cannot contain the Project Name: '${projectToEdit.name}'`,
};
}
}
break;

Expand Down

0 comments on commit 5be05c0

Please sign in to comment.