fix: bug in the content type parser of fastify
This commit is contained in:
+9
-1
@@ -50,7 +50,15 @@ import { WalletsModule } from "./modules/wallets/wallets.module";
|
|||||||
CacheModule.registerAsync(cacheConfig()),
|
CacheModule.registerAsync(cacheConfig()),
|
||||||
TypeOrmModule.forRootAsync(databaseConfigs()),
|
TypeOrmModule.forRootAsync(databaseConfigs()),
|
||||||
HttpModule.register({ global: true, timeout: 10000, headers: { "Content-Type": "application/json" } }),
|
HttpModule.register({ global: true, timeout: 10000, headers: { "Content-Type": "application/json" } }),
|
||||||
FastifyMulterModule,
|
FastifyMulterModule.register({
|
||||||
|
limits: {
|
||||||
|
fileSize: 10 * 1024 * 1024,
|
||||||
|
fieldNameSize: 200,
|
||||||
|
fieldSize: 10 * 1024 * 1024,
|
||||||
|
fields: 10,
|
||||||
|
parts: 10,
|
||||||
|
},
|
||||||
|
}),
|
||||||
AuthModule,
|
AuthModule,
|
||||||
UsersModule,
|
UsersModule,
|
||||||
TicketsModule,
|
TicketsModule,
|
||||||
|
|||||||
+11
-1
@@ -10,7 +10,17 @@ import { PaginationInterceptor } from "./core/interceptors/pagination.intercepto
|
|||||||
import { ResponseInterceptor } from "./core/interceptors/response.interceptor";
|
import { ResponseInterceptor } from "./core/interceptors/response.interceptor";
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const logger = new Logger("APP");
|
const logger = new Logger("APP");
|
||||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
|
|
||||||
|
const fastifyAdapter = new FastifyAdapter({
|
||||||
|
bodyLimit: 10 * 1024 * 1024,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add multipart content type parser
|
||||||
|
fastifyAdapter.getInstance().addContentTypeParser("multipart/form-data", (_request, _payload, done) => {
|
||||||
|
done(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
const app = await NestFactory.create<NestFastifyApplication>(AppModule, fastifyAdapter);
|
||||||
|
|
||||||
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
|
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
|
||||||
app.useGlobalInterceptors(new ResponseInterceptor(), new PaginationInterceptor(), new ClassSerializerInterceptor(app.get(Reflector)));
|
app.useGlobalInterceptors(new ResponseInterceptor(), new PaginationInterceptor(), new ClassSerializerInterceptor(app.get(Reflector)));
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ export class DiscountsService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const plan of subscriptionPlans) {
|
for (const plan of subscriptionPlans) {
|
||||||
plan.directDiscount = null!;
|
plan.directDiscount = null;
|
||||||
plan.price = new Decimal(plan.originalPrice);
|
plan.price = new Decimal(plan.originalPrice);
|
||||||
await queryRunner.manager.save(SubscriptionPlan, plan);
|
await queryRunner.manager.save(SubscriptionPlan, plan);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class SubscriptionPlan extends BaseEntity {
|
|||||||
userSubscriptions: UserSubscription[];
|
userSubscriptions: UserSubscription[];
|
||||||
|
|
||||||
@ManyToOne(() => Discount, (discount) => discount.subscriptionPlans, { nullable: true, onUpdate: "CASCADE" })
|
@ManyToOne(() => Discount, (discount) => discount.subscriptionPlans, { nullable: true, onUpdate: "CASCADE" })
|
||||||
directDiscount?: Discount;
|
directDiscount: Discount | null;
|
||||||
|
|
||||||
@DeleteDateColumn({ nullable: true })
|
@DeleteDateColumn({ nullable: true })
|
||||||
deletedAt?: Date;
|
deletedAt?: Date;
|
||||||
|
|||||||
Reference in New Issue
Block a user