Sửa lỗi nhấn + để thêm thành viên của tour
This commit is contained in:
Vendored
+2
-11
@@ -9,21 +9,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
};
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import { Pool } from 'pg';
|
||||
import 'dotenv/config';
|
||||
let PrismaService = class PrismaService extends PrismaClient {
|
||||
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(); }
|
||||
};
|
||||
PrismaService = __decorate([
|
||||
Injectable(),
|
||||
|
||||
Reference in New Issue
Block a user