diff options
| author | Ritesh Ghosh <[email protected]> | 2023-08-07 14:58:25 +0530 |
|---|---|---|
| committer | Ritesh Ghosh <[email protected]> | 2023-08-07 14:58:25 +0530 |
| commit | 84a79810c358dece1b3bd2b013a2d788ec100f44 (patch) | |
| tree | d6c52e37abc4a76a7da2e32a7ae7622ad22f11bd /src/controllers/homePage.controller.ts | |
| parent | 205619be557a7e1ac6152f370f440005feea0050 (diff) | |
| download | aniwatch-api-84a79810c358dece1b3bd2b013a2d788ec100f44.tar.xz aniwatch-api-84a79810c358dece1b3bd2b013a2d788ec100f44.zip | |
feat(controllerTypes): added request handler types
Diffstat (limited to 'src/controllers/homePage.controller.ts')
| -rw-r--r-- | src/controllers/homePage.controller.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/controllers/homePage.controller.ts b/src/controllers/homePage.controller.ts index c5ee45b..a3f7d53 100644 --- a/src/controllers/homePage.controller.ts +++ b/src/controllers/homePage.controller.ts @@ -1,12 +1,11 @@ +import { RequestHandler } from "express"; import { scrapeHomePage } from "../parsers"; -import { Request, Response, NextFunction, Handler } from "express"; // /anime/home -const getHomePage: Handler = async ( - req: Request, - res: Response, - next: NextFunction -) => { +const getHomePageInfo: RequestHandler< + unknown, + Awaited<ReturnType<typeof scrapeHomePage>> +> = async (req, res, next) => { try { const data = await scrapeHomePage(); res.status(200).json(data); @@ -16,4 +15,4 @@ const getHomePage: Handler = async ( } }; -export default getHomePage; +export default getHomePageInfo; |
