kt-template-online-api/src/middleware/save.middleware.ts
2026-05-08 11:21:51 +08:00

11 lines
296 B
TypeScript

import { Injectable, NestMiddleware } from '@nestjs/common';
import { Request, Response } from 'express';
@Injectable()
export class SaveMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: VoidFunction) {
Reflect.deleteProperty(req.body, 'id');
next();
}
}