Skip to content

Commit

Permalink
apidoc comments in EventController
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Oct 27, 2016
1 parent beb9e3c commit ed127a0
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions api/controllers/EventController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,24 @@

module.exports = {

/**
* Return all events from a specific user
/**
* @api {get} /event GET
* @apiName GetEvents
* @apiGroup Event
* @apiPermission authenticated
*
* @apiParam {Integer} [take] Number of events to return
* @apiParam {Integer} [skip] Where to start (for pagination)
*
* @apiSuccess {Integer} id Event id
* @apiSuccess {Integer} user User id
* @apiSuccess {Integer} house House id
* @apiSuccess {Integer} room Room id
* @apiSuccess {Integer} eventtype Event Type id
* @apiSuccess {String} code Event code
* @apiSuccess {String} name Event name
* @apiSuccess {String} description Event description
*
*/
index: function(req, res, next){
req.query.user = req.session.User;
Expand All @@ -19,6 +35,28 @@ module.exports = {
.catch(next);
},

/**
* @api {post} /event POST
* @apiName CreateEvent
* @apiGroup Event
* @apiPermission authenticated
*
* @apiParam {String} code Event code you want to create
* @apiParam {Integer} [user] id of the user concerned by the event (only for user-related event)
* @apiParam {Integer} [house] id of the house where the events take place
* @apiParam {Integer} [room] id of the room where the events take place
* @apiParam {Datetime} [datetime] If you want to specify a specific datetime when the event took place
*
* @apiSuccess {Integer} id Event id
* @apiSuccess {Integer} user User id
* @apiSuccess {Integer} house House id
* @apiSuccess {Integer} room Room id
* @apiSuccess {Integer} eventtype Event Type id
* @apiSuccess {String} code Event code
* @apiSuccess {String} name Event name
* @apiSuccess {String} description Event description
*
*/
create: function(req, res, next){

// get or post request are allowed
Expand Down

0 comments on commit ed127a0

Please sign in to comment.