fix types issue

This commit is contained in:
Chen, Tai-Lin committed 2024-03-11 21:04:32 +08:00
1 parent 807974d727
commit c4fd92e289
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -1,7 +1,10 @@
import type { Request, Response, NextFunction } from 'express' import type { Request, Response, NextFunction } from 'express'
import logger from '../utils/logger.js' import logger from '../utils/logger.js'
export function asyncHandler(fn: any) { export function asyncHandler(
// eslint-disable-next-line no-unused-vars
fn: (req: Request, res: Response, next: NextFunction) => Promise<void>
) {
return (req: Request, res: Response, next: NextFunction) => { return (req: Request, res: Response, next: NextFunction) => {
fn(req, res, next).catch(next) fn(req, res, next).catch(next)
} }
+1 -1
View File
@@ -6,7 +6,7 @@ export function hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, 10) return bcrypt.hash(password, 10)
} }
export function genJWT(payload: any): Promise<string> { export function genJWT(payload: { [key: string]: string }): Promise<string> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
jwt.sign( jwt.sign(
payload, payload,