GroupController
Summary
Defines an entity controller to handle requests relative to groups' entities.
Constructor
GroupController
Syntax
GroupController
()
Summary
Item Index
Methods
Methods
getEntitiesAction
Syntax
getEntitiesAction
(
-
request
-
response
-
next
Summary
Gets a list of groups.
Parameters:
-
request
RequestExpressJS HTTP Request
-
[query]
Object optionalRequest's query parameters
-
[include]
String | Array optionalThe list of fields to include from returned groups -
[exclude]
String | Array optionalThe list of fields to exclude from returned groups. Ignored if include is also specified. -
[query]
String optionalSearch query to search on both group names and descriptions -
[useSmartSearch=1]
Number optional1 to use a more advanced search mechanism, 0 to use a simple search based on a regular expression -
[page=0]
Number optionalThe expected page in pagination system -
[limit=10]
Number optionalThe maximum number of expected results -
[sortBy="name"]
String optionalThe field to sort by (either "name" or "description") -
[sortOrder="desc"]
String optionalThe sort order (either "asc" or "desc")
-
-
-
response
ResponseExpressJS HTTP Response
-
next
FunctionFunction to defer execution to the next registered middleware
Example:
// Response example
{
"entities" : [ ... ],
"pagination" : {
"limit": ..., // The limit number of groups by page
"page": ..., // The actual page
"pages": ..., // The total number of pages
"size": ... // The total number of groups
}
getProvider
Syntax
Summary
Gets an instance of the provider associated to the controller.
Returns:
GroupProvider:
The provider