fix: missing express type annotation

This commit is contained in:
wancat committed 2024-03-28 21:28:18 +08:00
1 parent 432084cc66
commit eb106c020a
6 files changed
+22 -9

No files matched your search

@@ -1,9 +1,11 @@
/* eslint-disable object-shorthand */
import type { Request, Response } from 'express'
import Pagination from '../models/pagination.js'
import { errorCommands } from '../models/commands.js'
// eslint-disable-next-line import/prefer-default-export
export async function commandListController(req: any, res: any): Promise<void> {
export async function commandListController(
req: Request,
res: Response
): Promise<void> {
const { nextKey, order } = req.query as { nextKey?: string; order: string }
const itemsPerPage = 100
+2 -2
View File
@@ -1,7 +1,7 @@
import { Request, Response } from 'express'
import { userCount } from '../models/users.js'
import { questList } from '../models/quests.js'
import { Request, Response } from 'express'
// eslint-disable-next-line import/prefer-default-export
export async function homeController(req: Request, res: Response) {
const quests = await questList()
const [totalQuests, totalCompleted] = quests.reduce(
+2 -2
View File
@@ -1,6 +1,6 @@
import { questList } from '../models/quests.js'
import { Request, Response } from 'express'
// eslint-disable-next-line import/prefer-default-export
import { questList } from '../models/quests.js'
export async function questListController(req: Request, res: Response) {
const quests = await questList()
quests.forEach((quest) => {
@@ -1,6 +1,7 @@
import { Request, Response } from 'express'
import Pagination from '../models/pagination.js'
import { sessionList, sessionDetail } from '../models/sessions.js'
import { Request, Response } from 'express'
export async function sessionListController(req: Request, res: Response) {
const { nextKey, order } = req.query as { nextKey: string; order: string }
const itemsPerPage = 50
+2 -1
View File
@@ -1,7 +1,8 @@
import { Request, Response } from 'express'
import mongoose from 'mongoose'
import Pagination from '../models/pagination.js'
import { userList, userDetail, idToUser } from '../models/users.js'
import { Request, Response } from 'express'
export async function userListController(req: Request, res: Response) {
const { nextKey, order } = req.query as { nextKey: string; order: string }
const itemsPerPage = 50