Skip to content

Commit

Permalink
Merge pull request #82 from RotaruDan/sessionsStudentsFix
Browse files Browse the repository at this point in the history
Fixes session students bug. Improves games routes documentation
  • Loading branch information
gorco authored Dec 20, 2016
2 parents 5ad9c39 + 627138c commit 3753ef1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ module.exports = (function () {
name: name,
created: new Date(),
authors: [username],
teachers: [username]
teachers: [username],
students: []
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion lib/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = (function () {
name: name,
allowAnonymous: false,
created: new Date(),
students: result.version.students,
students: result.class.students,
teachers: teachersArray
});
});
Expand Down
9 changes: 5 additions & 4 deletions routes/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ router.post('/', function (req, res) {
* @apiParam {String[]} [developers] Array with the username of the authors that you want to add to the game. Also can be a String
* @apiParamExample {json} Request-Example:
* {
* "name": "My New Name",
* "title": ["Some Username"]
* "title": "My New Name",
* "developers": ["Some Username"],
* "public": "true"
* }
*
* @apiSuccess(200) Success.
Expand All @@ -124,7 +125,7 @@ router.post('/', function (req, res) {
* "_id": "559a447831b7acec185bf513",
* "title": "My Game"
* "authors": ["someDeveloper"],
* "developers": ["someDeveloper"],
* "developers": ["Some Username"],
* "public": "true"
* }
*/
Expand Down Expand Up @@ -153,7 +154,7 @@ router.put('/:gameId', function (req, res) {
* "_id": "559a447831b7acec185bf513",
* "title": "My Game"
* "authors": ["someDeveloper"],
* "developers": ["someDeveloper"],
* "developers": [],
* "public": "true"
* }
*/
Expand Down

0 comments on commit 3753ef1

Please sign in to comment.