Skip to content

Commit 33e3461

Browse files
committed
fix(boot): fix boot scripts
1 parent 0df8443 commit 33e3461

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
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
*/
96
export 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
}

template/server/boot/create-admin.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import 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
})

0 commit comments

Comments
 (0)