The method should directly take the arguments in and override the method to set it:
constructor(router: Router) {
super(router, '/view', true); // <-- the string is the path ('/view'), true will be if need to be authorised
}
public async OnGet(req: Request, res: Response, next: NextFunction) {
// ...
}
The constructor can also take in the path for this page, since it should be the same for all the methods in here.
It can also take in a boolean to determine if it should use the UserMiddleware.Authorise middleware
Current Behaviour
Currently the on get methods are just called and then are where i put the
router.get
code in:Requested Behaviour
The method should directly take the arguments in and override the method to set it:
The constructor can also take in the path for this page, since it should be the same for all the methods in here.
It can also take in a boolean to determine if it should use the
UserMiddleware.Authorise
middleware