fixed issue #552

parent 19086f8e
...@@ -46,6 +46,7 @@ module.exports = { ...@@ -46,6 +46,7 @@ module.exports = {
id_sup: <supervisor ID> id_sup: <supervisor ID>
id_stu: <student ID> id_stu: <student ID>
id_ins: <instruction ID> id_ins: <instruction ID>
begin: <begin timestamp in ISO format>
* } * }
* @param {response} res * @param {response} res
* { * {
...@@ -55,18 +56,19 @@ module.exports = { ...@@ -55,18 +56,19 @@ module.exports = {
create: function(req, res) { create: function(req, res) {
var params = req.allParams(); var params = req.allParams();
sails.debug.log(JSON.stringify(params)); sails.log.debug(JSON.stringify(params));
if (!params.id_sup) res.badRequest("No supervisor defined"); if (!params.id_sup) res.badRequest("No supervisor defined");
if (!params.id_ins) res.badRequest("No instruction defined"); if (!params.id_ins) res.badRequest("No instruction defined");
if (!params.id_stu) res.badRequest("No student defined"); if (!params.id_stu) res.badRequest("No student defined");
if (!params.begin) res.badRequest("No start timestamp defined");
if (!params.desc) params.desc = ""; if (!params.desc) params.desc = "";
var data = {}; var data = {};
data.supervisor = params.id_sup; data.supervisor = params.id_sup;
data.instruction = params.id_ins; data.instruction = params.id_ins;
data.description = params.desc; data.description = params.desc;
sails.debug.log("BEGIN " + params.begin); sails.log.debug("BEGIN " + params.begin);
data.begin = params.begin; // data comes in ISO format data.begin = params.begin; // data comes in ISO format
StuOpenTry.findOne({or: [ // pending open try? StuOpenTry.findOne({or: [ // pending open try?
......
...@@ -177,4 +177,4 @@ dashboardApp.factory('newconfirm', function ($window, $q, $timeout) { ...@@ -177,4 +177,4 @@ dashboardApp.factory('newconfirm', function ($window, $q, $timeout) {
// force websocket transport protocol // force websocket transport protocol
io.sails.transports=['polling']; //io.sails.transports=['polling'];
...@@ -12,7 +12,8 @@ String.prototype.hashCode = function() { ...@@ -12,7 +12,8 @@ String.prototype.hashCode = function() {
return hash; return hash;
}; };
io.sails.transports=['websocket']; // force transport protocol for websockets
// io.sails.transports=['websocket'];
// Creamos el módulo dashboardControllers, de donde colgarán todos los controladores // Creamos el módulo dashboardControllers, de donde colgarán todos los controladores
var dashboardControllers = angular.module('dashboardControllers', ['dashboardConfig']); var dashboardControllers = angular.module('dashboardControllers', ['dashboardConfig']);
......
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