Extends
Members
(static) services
Defines the services required by this controller.
- Source:
 
Methods
create(req, res, next)
Create a new instance of the resource managed by this controller. Input taken from req.body is validated before the resource is created.
| Name | Type | Description | 
|---|---|---|
req | 
            
            Express/Request | the Express request  | 
        
res | 
            
            Express/Response | the Express response  | 
        
next | 
            
            function | the error handler  | 
        
- Source:
 
delete(req, res, next)
Delete an instance of the resource managed by this controller with the ID "req.params.id".
| Name | Type | Description | 
|---|---|---|
req | 
            
            Express/Request | the Express request  | 
        
res | 
            
            Express/Response | the Express response  | 
        
next | 
            
            function | the error handler  | 
        
- Source:
 
form() → {module:flitter-forms/Validator~Validator}
Get the registered validator with the name of this controller's resource.
- Source:
 
model() → {module:flitter-orm/src/model/Model~Model}
Get the registered model CLASS with the name of this controller's resource.
- Source:
 
name() → {string|null}
Get the name of the resource managed by this controller. Should be a Flitter canonical name.
- Source:
 
null
- Type
 - string | null
 
read(req, res, next)
Retrieve an instance of the resource managed by this controller with the ID "req.params.id".
| Name | Type | Description | 
|---|---|---|
req | 
            
            Express/Request | the Express request  | 
        
res | 
            
            Express/Response | the Express response  | 
        
next | 
            
            function | the error handler  | 
        
- Source:
 
send(res, bodyopt)
Send a JSON formatted, API-style response.
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
res | 
            
            Express/Response | the Express response  | 
        ||
body | 
            
            object | 
                
                    <optional> | 
            
            
                {} | the response information. Accepts the following fields, optionally: "status", "message", and "data"  | 
        
- Source:
 
update(req, res, next)
Update an instance of the resource managed by this controller with the ID "req.params.id". Any input taken from req.body is validated before updating.
| Name | Type | Description | 
|---|---|---|
req | 
            
            Express/Request | the Express request  | 
        
res | 
            
            Express/Response | the Express response  | 
        
next | 
            
            function | the error handler  | 
        
- Source: