feat(lead-forms): real file upload under 200KB and Jalali date

Public form file fields compress images or reject oversized files; dates use the full Jalali picker.
This commit is contained in:
2026-10-22 14:28:42 +03:30
parent 31f45a6a31
commit 80fb5bf1bb
4 changed files with 293 additions and 6 deletions
+13 -1
View File
@@ -1,11 +1,23 @@
import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { json, urlencoded } from 'express';
import type { Request } from 'express';
import { brand } from '@mento/shared';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, { rawBody: true });
// bodyParser خاموش تا سقف ۲ مگ برای پیوست فشردهٔ فرم عمومی + حفظ rawBody برای وب‌هوک
const app = await NestFactory.create(AppModule, { bodyParser: false });
app.use(
json({
limit: '2mb',
verify: (req: Request, _res, buf) => {
(req as Request & { rawBody?: Buffer }).rawBody = Buffer.from(buf);
},
}),
);
app.use(urlencoded({ extended: true, limit: '2mb' }));
const config = app.get(ConfigService);
app.setGlobalPrefix('api');