solved default method and instruction names

parent ad3a84b0
......@@ -120,10 +120,15 @@ module.exports = {
if (!student.surname || student.surname.length == 0)
student.surname = sails.__({phrase: 'no_surname', locale: student.lang});
student.attributes = Student.getValidAttributes(student.attributes);
if (student.lastInstruction && student.lastInstruction[0]) {
student.current_method = student.lastInstruction[0] ? student.lastInstruction[0].met_name : "no_method";
student.current_instruction = student.lastInstruction[0] ? student.lastInstruction[0].ins_name : "no_instruction";
}
if (student.lastInstruction && student.lastInstruction[0] && student.lastInstruction[0].met_name) {
student.current_method = student.lastInstruction[0].met_name;
student.current_instruction = student.lastInstruction[0].ins_name;
}
else {
student.current_method = "no_method";
student.current_instruction = "no_instruction";
}
delete student.password;
return student;
},
......
......@@ -128,7 +128,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
$scope.formUser.country = data.country;
$scope.formUser.gender = data.gender;
$scope.formUser.lang = data.lang;
$scope.formUser.name = data.name;
$scope.formUser.name = data.name;
$scope.studentData.name = data.name;
$scope.studentData.surname = data.surname;
$scope.formUser.notes = data.notes;
$scope.formUser.surname = data.surname;
$scope.formUser.username = data.username;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment