mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
fix: seed file warnings
This commit is contained in:
@@ -8,7 +8,6 @@ export default class extends BaseSeeder {
|
||||
static environment = ['development', 'testing'];
|
||||
|
||||
async run() {
|
||||
// eslint-disable-next-line unicorn/no-await-expression-member
|
||||
const users = await getUserIds();
|
||||
|
||||
const collections = faker.helpers.multiple(
|
||||
@@ -26,14 +25,16 @@ export async function getUserIds() {
|
||||
return users.map(({ id }) => id);
|
||||
}
|
||||
|
||||
let collectionId = 0;
|
||||
function createRandomCollection(userIds: User['id'][]) {
|
||||
const authorId = faker.helpers.arrayElements(userIds, 1).at(0);
|
||||
collectionId++;
|
||||
return {
|
||||
id: faker.string.uuid(),
|
||||
id: collectionId,
|
||||
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
|
||||
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
|
||||
visibility: Visibility.PRIVATE,
|
||||
nextId: undefined,
|
||||
nextId: collectionId + 1,
|
||||
authorId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ export default class extends BaseSeeder {
|
||||
static environment = ['development', 'testing'];
|
||||
|
||||
async run() {
|
||||
// eslint-disable-next-line unicorn/no-await-expression-member
|
||||
const users = await getUserIds();
|
||||
|
||||
const links = await Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user