{"size": 2651, "ext": "js", "max_stars_repo_path": "server/controllers/Courses.js", "max_stars_repo_name": "marc101101/PS_SS18_vhsLangquaid", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/controllers/Courses.js", "max_issues_repo_name": "marc101101/PS_SS18_vhsLangquaid", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/controllers/Courses.js", "max_forks_repo_name": "marc101101/PS_SS18_vhsLangquaid", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.8255813953, "max_line_length": 102, "alphanum_fraction": 0.6774801962}
'use strict';

var utils = require('../utils/writer.js');
var Courses = require('../service/CoursesService');

var verifyToken = require('../utils/VerifyToken');

module.exports.coursesCourse_idApplyPOST = function coursesCourse_idApplyPOST (req, res, next) {
  verifyToken(req, res, (decoded) => {
    var course_id = req.swagger.params['course_id'].value;
    Courses.coursesCourse_idApplyPOST(course_id, req)
      .then(function (response) {
        utils.writeJson(res, response);
      })
      .catch(function (response) {
        utils.writeJson(res, response);
      });
  });
};

module.exports.coursesCourse_idFeedbackPOST = function coursesCourse_idFeedbackPOST (req, res, next) {
  var course_id = req.swagger.params['course_id'].value;
  var data = req.swagger.params['data'].value;
  Courses.coursesCourse_idFeedbackPOST(course_id,data)
    .then(function (response) {
      utils.writeJson(res, response);
    })
    .catch(function (response) {
      utils.writeJson(res, response);
    });
};

module.exports.coursesCourse_idGET = function coursesCourse_idGET (req, res, next) {
  var course_id = req.swagger.params['course_id'].value;
  Courses.coursesCourse_idGET(course_id)
    .then(function (response) {
      utils.writeJson(res, response);
    })
    .catch(function (response) {
      utils.writeJson(res, response);
    });
};

module.exports.coursesCourse_idSignoffPOST = function coursesCourse_idSignoffPOST (req, res, next) {
  verifyToken(req, res, (decoded) => {
    var course_id = req.swagger.params['course_id'].value;
    Courses.coursesCourse_idSignoffPOST(course_id, req)
      .then(function (response) {
        utils.writeJson(res, response);
      })
      .catch(function (response) {
        utils.writeJson(res, response);
      });
  });
};

module.exports.coursesGET = function coursesGET (req, res, next) {
  let query = req.swagger.params['search'].value;
  Courses.coursesGET(query)
    .then(function (response) {
      utils.writeJson(res, response);
    })
    .catch(function (response) {
      utils.writeJson(res, response);
    });
};

module.exports.coursesHighlightsGET = function coursesHighlightsGET (req, res, next) {
  Courses.coursesHighlightsGET()
    .then(function (response) {
      utils.writeJson(res, response);
    })
    .catch(function (response) {
      utils.writeJson(res, response);
    });
};

module.exports.coursesLastminuteGET = function coursesLastminuteGET (req, res, next) {
  Courses.coursesLastminuteGET()
    .then(function (response) {
      utils.writeJson(res, response);
    })
    .catch(function (response) {
      utils.writeJson(res, response);
    });
};