From ffaccaadf257cc150bf41c04f4893bfd13052674 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 5 Oct 2025 20:15:10 +0800 Subject: [PATCH] refactor: clean up unused variables in routes/ssh.ts - Remove unused imports (NextFunction, jwt) - Remove 6 unused variables (result, updateResult, name x3) - All 8 no-unused-vars errors fixed --- src/backend/database/routes/ssh.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/backend/database/routes/ssh.ts b/src/backend/database/routes/ssh.ts index 3cb76e67..23f7191d 100644 --- a/src/backend/database/routes/ssh.ts +++ b/src/backend/database/routes/ssh.ts @@ -9,8 +9,7 @@ import { fileManagerShortcuts, } from "../db/schema.js"; import { eq, and, desc, isNotNull, or } from "drizzle-orm"; -import type { Request, Response, NextFunction } from "express"; -import jwt from "jsonwebtoken"; +import type { Request, Response } from "express"; import multer from "multer"; import { sshLogger } from "../../utils/logger.js"; import { SimpleDBOps } from "../../utils/simple-db-ops.js"; @@ -816,7 +815,7 @@ router.delete( ), ); - const result = await db + await db .delete(sshData) .where(and(eq(sshData.id, numericHostId), eq(sshData.userId, userId))); @@ -943,7 +942,7 @@ router.delete( authenticateJWT, async (req: Request, res: Response) => { const userId = (req as any).userId; - const { hostId, path, name } = req.body; + const { hostId, path } = req.body; if (!isNonEmptyString(userId) || !hostId || !path) { sshLogger.warn("Invalid data for recent file deletion"); @@ -1063,7 +1062,7 @@ router.delete( authenticateJWT, async (req: Request, res: Response) => { const userId = (req as any).userId; - const { hostId, path, name } = req.body; + const { hostId, path } = req.body; if (!isNonEmptyString(userId) || !hostId || !path) { sshLogger.warn("Invalid data for pinned file deletion"); @@ -1183,7 +1182,7 @@ router.delete( authenticateJWT, async (req: Request, res: Response) => { const userId = (req as any).userId; - const { hostId, path, name } = req.body; + const { hostId, path } = req.body; if (!isNonEmptyString(userId) || !hostId || !path) { sshLogger.warn("Invalid data for shortcut deletion"); @@ -1558,7 +1557,7 @@ router.post( } } - const updateResult = await db + await db .update(sshData) .set({ autostartPassword: decryptedConfig.password || null, @@ -1615,7 +1614,7 @@ router.delete( } try { - const result = await db + await db .update(sshData) .set({ autostartPassword: null,