Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faker definition for relationship properties #301

Open
SalahAdDin opened this issue Feb 28, 2024 · 0 comments
Open

Faker definition for relationship properties #301

SalahAdDin opened this issue Feb 28, 2024 · 0 comments

Comments

@SalahAdDin
Copy link

It is very annoying to have to create a whole object just cause one of the properties, the relationship, is not filling by default:

  continueArticle: {
    id: primaryKey(() => _continueId++),
    title: () => faker.lorem.words(),
    slug: () => faker.helpers.slugify(title),
    publishedDate: () => faker.date.anytime(),
    category: oneOf("category"),
    thumbnail: oneOf("image"),
  },
export const createContinueArticle = (relatedArticle = {}) =>
db.continueArticle.create(relatedArticle);

image

Is there any away to make it getting any existing object to fill the relation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant