mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
update seed
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import argon2 from 'argon2';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { faker } from '@faker-js/faker';
|
||||
import crypto from 'crypto';
|
||||
import DBClient from '../../DBClient';
|
||||
|
||||
interface CreateNewUsersArgs {
|
||||
@@ -17,10 +18,11 @@ const createNewUsers = async ({ numberOfUsers }: CreateNewUsersArgs) => {
|
||||
|
||||
// eslint-disable-next-line no-plusplus
|
||||
for (let i = 0; i < numberOfUsers; i++) {
|
||||
const randomValue = crypto.randomBytes(2).toString('hex');
|
||||
const firstName = faker.name.firstName();
|
||||
const lastName = faker.name.lastName();
|
||||
const username = `${firstName[0]}.${lastName}.${i}`;
|
||||
const email = faker.internet.email(firstName, lastName + i, 'example.com');
|
||||
const username = `${firstName[0]}.${lastName}.${randomValue}`;
|
||||
const email = faker.internet.email(firstName, randomValue, 'example.com');
|
||||
|
||||
const hash = hashedPasswords[i];
|
||||
const dateOfBirth = faker.date.birthdate({ mode: 'age', min: 19 });
|
||||
|
||||
Reference in New Issue
Block a user