UserController
Summary
Defines an entity controller to handle requests relative to users' entities.
Constructor
UserController
Syntax
UserController
()
Summary
Item Index
Methods
getEntitiesAction
Syntax
getEntitiesAction
(
-
request
-
response
-
next
Summary
Gets a list of users.
Parameters:
-
request
RequestExpressJS HTTP Request
-
[query]
Object optionalRequest's query parameters
-
[include]
String | Array optionalThe list of fields to include from returned users -
[exclude]
String | Array optionalThe list of fields to exclude from returned users. Ignored if include is also specified. -
[query]
String optionalSearch query to search in user names -
[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 (only "name" is available right now) -
[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 users by page
"page": ..., // The actual page
"pages": ..., // The total number of pages
"size": ... // The total number of users
}
getProvider
Syntax
Summary
Gets an instance of the provider associated to the controller.
Returns:
UserProvider:
The provider
updateEntityAction
Syntax
updateEntityAction
(
-
request
-
response
-
next
Summary
Updates a user.
Parameters:
Example:
// Response example
{
"total": 1
}