Sửa lỗi nhấn + để thêm thành viên của tour

This commit is contained in:
2026-06-14 17:16:19 +07:00
parent c6d0fdd5d1
commit 81e715ddb3
24 changed files with 515 additions and 239 deletions
+3 -14
View File
@@ -1,23 +1,12 @@
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
import { PrismaPg } from '@prisma/adapter-pg';
import { Pool } from 'pg';
import 'dotenv/config';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
private pool: Pool;
constructor() {
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const adapter = new PrismaPg(pool);
super({ adapter });
this.pool = pool;
super();
}
async onModuleInit() { await this.$connect(); }
async onModuleDestroy() {
await this.$disconnect();
await this.pool.end();
}
}
async onModuleDestroy() { await this.$disconnect(); }
}