reverse change

This commit is contained in:
Chen, Tai-Lin committed 2024-03-25 14:53:44 +08:00
1 parent c4fd92e289
commit 59a0865157
9 files changed
+14 -17

No files matched your search

@@ -17,7 +17,7 @@ export async function commandListController(req, res) {
nextKey: newNextKey,
order: pagination.getOrder(),
})
} catch (error: any) {
} catch (error) {
console.error(error)
res.status(500).send('Error fetching data')
}
@@ -15,7 +15,7 @@ export async function sessionListController(req, res) {
nextKey: newNextKey,
order: pagination.getOrder(),
})
} catch (error: any) {
} catch (error) {
console.log(error)
res.status(500).send('Error fetching session data')
}
+1 -1
View File
@@ -15,7 +15,7 @@ export async function userListController(req, res) {
nextKey: newNextKey,
order: pagination.getOrder(),
})
} catch (error: any) {
} catch (error) {
console.error(error)
res.status(500).send('Error fetching user data')
}
+1 -1
View File
@@ -3,7 +3,7 @@ import { Strategy as GoogleStrategy } from 'passport-google-oidc'
import config from '../config.js'
import oauthVerify from './oauthVerify.js'
function verify(profile: any, cb: any) {
function verify(issuer: string, profile: any, cb: any) {
oauthVerify('google', profile, { 'socialLogins.google.id': profile.id }, cb)
}
+2 -2
View File
@@ -9,7 +9,7 @@ async function verifyPassword(
username: string,
password: string,
done: (
error: Error | null,
error: any,
user?: Express.User | false,
options?: IVerifyOptions
) => void
@@ -34,7 +34,7 @@ async function verifyPassword(
username: user.username,
email: user.email,
})
} catch (err: any) {
} catch (err) {
return done(err)
}
}
+2 -2
View File
@@ -82,7 +82,7 @@ export async function deleteContainer(id: string) {
}
try {
await container.stop()
} catch (error: any) {
} catch (error) {
logger.warn('Failed to stop container', id)
}
await container.remove()
@@ -127,7 +127,7 @@ export function buildQuestImage(questPath: string, questId: string) {
.forEach((line: string) => {
parseJSONOutput(line)
})
} catch (error: any) {
} catch (error) {
reject(error)
}
})
+2 -5
View File
@@ -1,10 +1,7 @@
import type { Request, Response, NextFunction } from 'express'
import logger from '../utils/logger.js'
export function asyncHandler(
// eslint-disable-next-line no-unused-vars
fn: (req: Request, res: Response, next: NextFunction) => Promise<void>
) {
export function asyncHandler(fn: any) {
return (req: Request, res: Response, next: NextFunction) => {
fn(req, res, next).catch(next)
}
@@ -12,7 +9,7 @@ export function asyncHandler(
// eslint-disable-next-line no-unused-vars
export default function errorHandler(
err: Error,
err: any,
req: Request,
res: Response,
// eslint-disable-next-line no-unused-vars
+1 -1
View File
@@ -6,7 +6,7 @@ export function hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, 10)
}
export function genJWT(payload: { [key: string]: string }): Promise<string> {
export function genJWT(payload: any): Promise<string> {
return new Promise((resolve, reject) => {
jwt.sign(
payload,
+3 -3
View File
@@ -9,9 +9,9 @@ const questDirectory = path.join(process.cwd(), '..', 'quests')
class QuestValidationError extends Error {
questId: string
error: Error | null
error: any
constructor(message: string, questId: string, error: Error | null) {
constructor(message: string, questId: string, error: any) {
super(message)
this.name = 'QuestValidationError'
this.questId = questId
@@ -68,7 +68,7 @@ export async function loadAndUpdateQuests() {
})
quest.exceptions.push(...exceptions)
await quest.save()
} catch (error: any) {
} catch (error) {
logger.error(`Error parsing quest`, { id, error })
throw new QuestValidationError(`Error parsing quest`, id, error)
}