fix: seed file warnings

This commit is contained in:
Sonny
2024-07-07 20:26:09 +02:00
parent fd896db872
commit 5baa9e1c35
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ export default class extends BaseSeeder {
static environment = ['development', 'testing']; static environment = ['development', 'testing'];
async run() { async run() {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds(); const users = await getUserIds();
const collections = faker.helpers.multiple( const collections = faker.helpers.multiple(
@@ -26,14 +25,16 @@ export async function getUserIds() {
return users.map(({ id }) => id); return users.map(({ id }) => id);
} }
let collectionId = 0;
function createRandomCollection(userIds: User['id'][]) { function createRandomCollection(userIds: User['id'][]) {
const authorId = faker.helpers.arrayElements(userIds, 1).at(0); const authorId = faker.helpers.arrayElements(userIds, 1).at(0);
collectionId++;
return { return {
id: faker.string.uuid(), id: collectionId,
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }), name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }), description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
visibility: Visibility.PRIVATE, visibility: Visibility.PRIVATE,
nextId: undefined, nextId: collectionId + 1,
authorId, authorId,
}; };
} }

View File

@@ -9,7 +9,6 @@ export default class extends BaseSeeder {
static environment = ['development', 'testing']; static environment = ['development', 'testing'];
async run() { async run() {
// eslint-disable-next-line unicorn/no-await-expression-member
const users = await getUserIds(); const users = await getUserIds();
const links = await Promise.all( const links = await Promise.all(