StudentController

StudentController handle with Student Resource Api. Pass a Student Object Model(\Models\StudentModel) to the constructor of parent class (\Controller\BaseController) for it map the basic database crud operations to this Object.

Extends

Methods

inner removeBookFromList(userId, bookIdId)

Get user books and filter through passed book ID
Parameters:
Name Type Description
userId Long
bookIdId Long

inner removeByLogin(req, res) → {json}

RemoveByLogin method. Responds to DELETE /student/:login. If Success returns 200 status code and a json with number of rows affected (one). If error return 400 status code and a json => { errors }. 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.
To Do:
  • Write comments

inner studentByLogin(req, res) → {json}

StudentByLogin method. Responds to GET /student/:login. If Success returns 200 status code and a json with student data. If error return 400 status code and a json => { errors } 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.
To Do:
  • Write comments

inner updateByLogin(req, res) → {json}

UpdateByLogin method. Responds to PUT /student/:login. If Success returns 200 status code and a json with student data. If error return 400 status code and a json => { errors } 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.
To Do:
  • Write comments