Refactor type annotations and router initialization
Standardized type annotations for interfaces in user.ts and improved type safety in webapi.ts. Updated all Express router initializations to explicitly declare the Router type. Added missing RequestHandler typings in uploader modules for better type checking.
This commit is contained in:
1 parent
772f07c58b
commit
01958d47a4
16 files changed
+123
-121
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import multer from 'multer';
|
||||
import { Request, Response } from 'express';
|
||||
import { Request, Response, RequestHandler } from 'express';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { randomUUID } from 'crypto';
|
||||
@@ -65,7 +65,7 @@ export const createDiskStorage = (uploadPath: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const createDiskUpload = (uploadPath: string) => {
|
||||
export const createDiskUpload = (uploadPath: string): RequestHandler => {
|
||||
const upload = multer({
|
||||
storage: createDiskStorage(uploadPath),
|
||||
limits: {
|
||||
|
||||
Reference in new issue
Block a user