Skip to content

Commit 0883ff9

Browse files
committed
lib/homepage/index.ts
lint: lib/homepage/index.ts - add typing annotate
1 parent 10e1cfe commit 0883ff9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/homepage/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {logger} from '../logger'
66
import {Request, Response} from "express";
77

88

9-
export async function showIndex(req: Request, res: Response) {
9+
export async function showIndex(req: Request, res: Response): Promise<void> {
1010
const isLogin = req.isAuthenticated()
1111
const deleteToken = ''
1212

@@ -25,14 +25,14 @@ export async function showIndex(req: Request, res: Response) {
2525

2626
const user = await User.findOne({
2727
where: {
28-
id: (req.user as any).id
28+
id: req.user.id
2929
}
3030
})
3131
if (user) {
3232
data.deleteToken = user.deleteToken
3333
return res.render('index.ejs', data)
3434
}
3535

36-
logger.error(`error: user not found with id ${(req.user as any).id}`)
36+
logger.error(`error: user not found with id ${req.user.id}`)
3737
return res.render('index.ejs', data)
3838
}

0 commit comments

Comments
 (0)