Feat: Update user validation schema to include username/email check

The validation schema will throw an error if the username or email is already found in the database.
This commit is contained in:
Aaron William Po
2023-05-11 22:21:49 -04:00
parent 2eb2626d54
commit 9574bbaeb9
9 changed files with 226 additions and 59 deletions

View File

@@ -53,7 +53,16 @@ const createNewUsers = async ({ numberOfUsers }: CreateNewUsersArgs) => {
const dateOfBirth = faker.date.birthdate({ mode: 'age', min: 19 });
const createdAt = faker.date.past(1);
const user = { firstName, lastName, email, username, dateOfBirth, createdAt, hash };
const user = {
firstName,
lastName,
email,
username,
dateOfBirth,
createdAt,
hash,
accountIsVerified: true,
};
data.push(user);
}