File tree 2 files changed +1
-31
lines changed 2 files changed +1
-31
lines changed Original file line number Diff line number Diff line change 1
1
/* 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';
5
2
6
3
/**
7
4
* Create the initial data of the system
8
5
*/
9
6
export default function addInitialData ( server ) {
10
- // const Teacher = server.models.Teacher;
11
- // const Classroom = server.models.Classroom;
12
- // const Student = server.models.Student;
13
7
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);
35
8
}
Original file line number Diff line number Diff line change 1
1
import initialAccount from '../initial-data/maintenance-account.json' ;
2
2
3
- export const email = initialAccount . email ;
4
- export const password = initialAccount . password ;
5
-
6
3
/**
7
4
* Create the first admin user if there are not users in the system
8
5
*/
@@ -15,7 +12,7 @@ export default function createAdmin(server) {
15
12
. find ( )
16
13
. then ( ( accounts ) => {
17
14
if ( accounts . length < 1 ) {
18
- return Account . create ( { email , password } ) ;
15
+ return Account . create ( initialAccount ) ;
19
16
}
20
17
return null ;
21
18
} )
You can’t perform that action at this time.
0 commit comments