Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2759a3d1
authored
Jan 17, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug with student update fixed
parent
c9b7c9a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
sails/conf/pictodb_init_keepsymbolstix.sql
sails/src/api/controllers/StudentController.js
sails/conf/pictodb_init_keepsymbolstix.sql
View file @
2759a3d1
DROP
DATABASE
symbolstixdb
;
GRANT
USAGE
ON
*
.
*
TO
'pictodbuser'
@
'localhost'
;
DROP
USER
'pictodbuser'
@
'localhost'
;
CREATE
USER
'pictodbuser'
@
'localhost'
identified
by
'p1KT015'
;
...
...
sails/src/api/controllers/StudentController.js
View file @
2759a3d1
/**
* 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"
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment