Commit 5b85ebae by Fernando Martínez Santiago

Merge branch 'master' of http://scm.ujaen.es/softuno/pictogram

parents 977bd2a2 2759a3d1
DROP DATABASE symbolstixdb;
GRANT USAGE ON *.* TO 'pictodbuser'@'localhost';
DROP USER 'pictodbuser'@'localhost';
CREATE USER 'pictodbuser'@'localhost' identified by 'p1KT015';
......
/**
* StudentController
/* StudentController
*
* @description :: Server-side logic for managing students
* @help :: See http://links.sailsjs.org/docs/controllers
......@@ -171,6 +171,8 @@ module.exports = {
Student.findOne(req.params.id_stu).exec(function(err, stu){
if (err || !stu)
return res.json(500, {error: "No student found"});
// copy attributes
for (k in req.body) stu[k] = req.body[k];
stu.save(function(err, saved) {
if (err)
return res.json(500, {error: "Error when saving student"});
......
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