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
81e74156
authored
Feb 13, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
better documented StudentController.update_picto and StudentController.update_category
parent
0cb90c84
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
6 deletions
sails/src/api/controllers/StudentController.js
sails/src/api/models/Student.js
sails/src/api/controllers/StudentController.js
View file @
81e74156
...
@@ -914,9 +914,41 @@ module.exports = {
...
@@ -914,9 +914,41 @@ module.exports = {
});
});
},
},
// update action
/*
// update picto atributes for a studentPicto
* Updates the attributes of a picto related to student, i.e. stu_picto records
//
* @param {request} req {
* 'id_stu': <student ID>,
* 'id_pic': <picto ID>,
* 'attributes': <object>
* }
*
* or
*
* @param {request} req {
* 'id_stuPicto': <stuPicto ID>,
* 'attributes': <object>
* }
*
* @param {response} res {
* id: <stu_picto ID>,
* student: <student ID>,
* attributes: {
* id_cat: categoryId or null,
* coord_x: 1 .. 5 or null,
* coord_y: 1 .. 10 or null,
* free_category_coord_x: 0 .. 4 or null,
* free_category_coord_y: 0 .. 9 or null,
* status: '[invisible]/enabled/disabled',
* highlight: true/[false],
* legend: true/[false],
* legend_size: '[small]/large',
* expression: 'custom expression',
* color: any valid HEX color or [null]
* }
* },
* }
*
*/
update_picto
:
function
(
req
,
res
)
{
update_picto
:
function
(
req
,
res
)
{
var
params
=
req
.
allParams
();
var
params
=
req
.
allParams
();
...
@@ -952,11 +984,24 @@ module.exports = {
...
@@ -952,11 +984,24 @@ module.exports = {
* 'prev_id_stu_pic': <ID of previous category entry in stu_picto>,
* 'prev_id_stu_pic': <ID of previous category entry in stu_picto>,
* 'new_id_pic': <ID of the picto to be the replacement>
* 'new_id_pic': <ID of the picto to be the replacement>
* }
* }
*
* @param {response} res {
* @param {response} res {
* 'id_stu_pic': <id of the new category in stu_picto>,
* id: <stu_picto ID>,
* 'attributes': <attributes of the new category picto>,
* student: <student ID>,
* 'picto': <picto information used as new category>
* attributes: {
* id_cat: categoryId or null,
* coord_x: 1 .. 5 or null,
* coord_y: 1 .. 10 or null,
* free_category_coord_x: 0 .. 4 or null,
* free_category_coord_y: 0 .. 9 or null,
* status: '[invisible]/enabled/disabled',
* highlight: true/[false],
* legend: true/[false],
* legend_size: '[small]/large',
* expression: 'custom expression',
* color: any valid HEX color or [null]
* }
* }
* },
*
*
*/
*/
update_category
:
function
(
req
,
res
)
{
update_category
:
function
(
req
,
res
)
{
...
...
sails/src/api/models/Student.js
View file @
81e74156
...
@@ -556,6 +556,23 @@ module.exports = {
...
@@ -556,6 +556,23 @@ module.exports = {
* This method homogenizes the responses in HTTP requests and Websockets
* This method homogenizes the responses in HTTP requests and Websockets
* @param id_stu_pic {ID} stu_picto record id
* @param id_stu_pic {ID} stu_picto record id
* @param cb {function(err, result)} callback function
* @param cb {function(err, result)} callback function
* @return result {
* id: <stu_picto ID>,
* student: <student ID>,
* attributes: {
* id_cat: categoryId or null,
* coord_x: 1 .. 5 or null,
* coord_y: 1 .. 10 or null,
* free_category_coord_x: 0 .. 4 or null,
* free_category_coord_y: 0 .. 9 or null,
* status: '[invisible]/enabled/disabled',
* highlight: true/[false],
* legend: true/[false],
* legend_size: '[small]/large',
* expression: 'custom expression',
* color: any valid HEX color or [null]
* }
* }
*/
*/
pictoInfo
:
function
(
id_stu_pic
,
cb
)
{
pictoInfo
:
function
(
id_stu_pic
,
cb
)
{
StuPicto
.
findOne
(
id_stu_pic
)
StuPicto
.
findOne
(
id_stu_pic
)
...
...
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