mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
fix: insert display order in lessons seeder
This commit is contained in:
parent
4c0377d234
commit
066caa6a9d
@ -7,7 +7,13 @@ export default class CourseSeeder extends BaseSeeder {
|
||||
public async run() {
|
||||
this.CourseFactory = CourseFactory;
|
||||
|
||||
await this.CourseFactory.with('lessons', 10, lessonFactory => lessonFactory.with('content'))
|
||||
const LESSONS_COUNT = 10;
|
||||
|
||||
await this.CourseFactory.with('lessons', LESSONS_COUNT, lessonFactory =>
|
||||
lessonFactory
|
||||
.with('content')
|
||||
.merge(new Array(LESSONS_COUNT).fill(LESSONS_COUNT).map((_, i) => ({ display_order: i + 1 })))
|
||||
)
|
||||
.with('category')
|
||||
.with('teacher')
|
||||
.createMany(3);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user