Skip to content

Commit

Permalink
rolled back #12 and opened feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Wohlert committed Feb 21, 2017
1 parent ae60305 commit 7c8db6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
21 changes: 1 addition & 20 deletions src/server/controller/api/contestant/contestantApiController.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@ module.exports = class ContestantApiController {

static save(request, response, next) {
// TODO: check if strings are empty


if (request.body.firstName === undefined || request.body.lastName === undefined) {
return response.status(400).json({success: false,
error: {text: 'Es wurden nicht alle notwendingen Felder ausgefüllt'}});
}

StudentApiController.unique(request.body.firstName, request.body.lastName, (result) => {
if (result === false) {
return response.status(200).json({
success: false,
error: {text: 'not_unique'}
});
} else {

}
});



if (request.body.firstName === undefined || request.body.lastName === undefined || request.body.course === undefined || request.body.year === undefined ||
request.body.description === undefined || request.file === undefined) {
return response.status(400).json({success: false,
Expand All @@ -65,6 +45,7 @@ module.exports = class ContestantApiController {
}
StudentApiController.validate(request.body, (validated, student) => {
if (validated === true) {
console.log(student);
contestantJSON.activated = false;
contestantJSON.image = request.file.filename;
// sanitize user inputs
Expand Down
2 changes: 1 addition & 1 deletion src/server/controller/api/student/studentApiController.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = class StudentApiController {
if (students.length > 1) {
return next(false, null);
} else if (students.length === 1) {
return next(true, students);
return next(true, student);
}
return next(false, null);
});
Expand Down

0 comments on commit 7c8db6b

Please sign in to comment.