refactor: Update type annotation for query result in complete-upload route

This commit is contained in:
2025-10-16 11:15:51 +02:00
parent ae452de3d0
commit 97b10716b3

View File

@@ -2,6 +2,7 @@ import { NextResponse } from 'next/server';
import pool from '@/lib/db'; import pool from '@/lib/db';
import bcrypt from 'bcrypt'; import bcrypt from 'bcrypt';
import crypto from 'crypto'; import crypto from 'crypto';
import { ResultSetHeader } from 'mysql2/promise';
const SALT_ROUNDS = 10; const SALT_ROUNDS = 10;
@@ -28,7 +29,7 @@ export async function POST(request: Request) {
const connection = await pool.getConnection(); const connection = await pool.getConnection();
try { try {
const [result]: [{ affectedRows: number }, unknown] = await connection.query( const [result]: [ResultSetHeader, unknown] = await connection.query(
'UPDATE files SET token_hash = ?, expires_at = ? WHERE id = ?', 'UPDATE files SET token_hash = ?, expires_at = ? WHERE id = ?',
[tokenHash, expiresAt, file_id] [tokenHash, expiresAt, file_id]
); );