Skip to content

Commit

Permalink
fix(boot): fix boot scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkc committed Mar 25, 2018
1 parent 0df8443 commit 33e3461
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
27 changes: 0 additions & 27 deletions template/server/boot/add-initial-data.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
/* eslint-disable no-unused-vars */
// import initialProf from '../../server/initial-data/example1-teacher';
// import initialClassroom from '../../server/initial-data/example1-classroom';
// import initialStudent from '../../server/initial-data/example1-student';

/**
* Create the initial data of the system
*/
export default function addInitialData(server) {
// const Teacher = server.models.Teacher;
// const Classroom = server.models.Classroom;
// const Student = server.models.Student;

// const createTeacher = () => {
// return Teacher.create(initialProf);
// };
// const createStudent = teacher => {
// initialStudent.teacherId = teacher.id;
// return Student.create(initialStudent)
// .then(student => ({teacher, student}));
// };
// const createClassroom = ({student, teacher}) => {
// initialClassroom.studentId = student.id;
// initialClassroom.teacherId = teacher.id;
// return Classroom.create(initialClassroom).then(classroom => ({
// teacher,
// student,
// classroom,
// }));
// };

// return createTeacher()
// .then(createStudent)
// .then(createClassroom);
}
5 changes: 1 addition & 4 deletions template/server/boot/create-admin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import initialAccount from '../initial-data/maintenance-account.json';

export const email = initialAccount.email;
export const password = initialAccount.password;

/**
* Create the first admin user if there are not users in the system
*/
Expand All @@ -15,7 +12,7 @@ export default function createAdmin(server) {
.find()
.then((accounts) => {
if (accounts.length < 1) {
return Account.create({email, password});
return Account.create(initialAccount);
}
return null;
})
Expand Down

0 comments on commit 33e3461

Please sign in to comment.