SudoSOS Back-end API / catalogue/product-categories / ProductCategoryController
Class: ProductCategoryController ​
The BaseController class is responsible for:
- Storing route definitions.
- Generating router objects based on the policy.
Extends ​
Constructors ​
Constructor ​
new ProductCategoryController(options): ProductCategoryController;Creates a new productcategory controller instance.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options | BaseControllerOptions | The options passed to the base controller. |
Returns ​
ProductCategoryController
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
roleManager | protected | RoleManager | A reference to the role manager passed in the base controller options. | BaseController.roleManager |
specification | public | SwaggerSpecification | A reference to the swagger specification passed in the base controller options. | BaseController.specification |
Methods ​
getPolicy() ​
getPolicy(): Policy;Gets the policy defined by child classes. This policy includes all routes that the controller accepts, the authorization middleware, and the final handler function for every route.
Returns ​
The policy of this controller.
Overrides ​
getRouter() ​
getRouter(): Router;Returns ​
Router
the router used by this controller.
Inherited from ​
postProductCategory() ​
postProductCategory(req, res): Promise<void>;POST /productcategories
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The created productcategory entity
Operation Id ​
createProductCategory
Tags ​
productCategories - Operations of productcategory controller
Security ​
JWT
returnAllProductCategories() ​
returnAllProductCategories(req, res): Promise<void>;GET /productcategories
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - All existing productcategories
Operation Id ​
getAllProductCategories
Tags ​
productCategories - Operations of productcategory controller
Security ​
JWT
returnSingleProductCategory() ​
returnSingleProductCategory(req, res): Promise<void>;GET /productcategories/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The requested productcategory entity
Operation Id ​
getSingleProductCategory
Tags ​
productCategories - Operations of productcategory controller
Security ​
JWT
updateProductCategory() ​
updateProductCategory(req, res): Promise<void>;PATCH /productcategories/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The patched productcategory entity
Operation Id ​
updateProductCategory
Tags ​
productCategories - Operations of productcategory controller
Security ​
JWT