Feat: add user header with follow info

This commit is contained in:
Aaron William Po
2023-11-12 23:24:33 -05:00
parent b939219c67
commit fd1f2b101f
11 changed files with 379 additions and 38 deletions

View File

@@ -24,20 +24,15 @@ const createNewUserFollows = async ({
const randomUsers = users
.filter((randomUser) => randomUser.id !== user.id)
.sort(() => Math.random() - Math.random())
.slice(0, 20);
.slice(0, 100);
// Get the user to follow the random users, and the random users to follow the user.
// Get the user to follow the random users
const data = randomUsers.flatMap((randomUser) => [
{
followerId: user.id,
followingId: randomUser.id,
followedAt: faker.date.between({ from: user.createdAt, to: new Date() }),
},
{
followerId: randomUser.id,
followingId: user.id,
followedAt: faker.date.between({ from: randomUser.createdAt, to: new Date() }),
},
]);
userFollows.push(...data);