File tree Expand file tree Collapse file tree 2 files changed +1
-31
lines changed Expand file tree Collapse file tree 2 files changed +1
-31
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable no-unused-vars */
2- // import initialProf from '../../server/initial-data/example1-teacher';
3- // import initialClassroom from '../../server/initial-data/example1-classroom';
4- // import initialStudent from '../../server/initial-data/example1-student';
52
63/**
74 * Create the initial data of the system
85 */
96export default function addInitialData ( server ) {
10- // const Teacher = server.models.Teacher;
11- // const Classroom = server.models.Classroom;
12- // const Student = server.models.Student;
137
14- // const createTeacher = () => {
15- // return Teacher.create(initialProf);
16- // };
17- // const createStudent = teacher => {
18- // initialStudent.teacherId = teacher.id;
19- // return Student.create(initialStudent)
20- // .then(student => ({teacher, student}));
21- // };
22- // const createClassroom = ({student, teacher}) => {
23- // initialClassroom.studentId = student.id;
24- // initialClassroom.teacherId = teacher.id;
25- // return Classroom.create(initialClassroom).then(classroom => ({
26- // teacher,
27- // student,
28- // classroom,
29- // }));
30- // };
31-
32- // return createTeacher()
33- // .then(createStudent)
34- // .then(createClassroom);
358}
Original file line number Diff line number Diff line change 11import initialAccount from '../initial-data/maintenance-account.json' ;
22
3- export const email = initialAccount . email ;
4- export const password = initialAccount . password ;
5-
63/**
74 * Create the first admin user if there are not users in the system
85 */
@@ -15,7 +12,7 @@ export default function createAdmin(server) {
1512 . find ( )
1613 . then ( ( accounts ) => {
1714 if ( accounts . length < 1 ) {
18- return Account . create ( { email , password } ) ;
15+ return Account . create ( initialAccount ) ;
1916 }
2017 return null ;
2118 } )
You can’t perform that action at this time.
0 commit comments