Fix TypeScript compilation errors and update .gitignore
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,6 +5,9 @@ node_modules/
|
||||
dist/
|
||||
build/
|
||||
|
||||
# Generated files
|
||||
backend/src/schema.gql
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
|
@ -26,7 +26,7 @@ import { MessagesModule } from './modules/messages/messages.module';
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'postgres',
|
||||
host: process.env.DATABASE_HOST || 'localhost',
|
||||
port: parseInt(process.env.DATABASE_PORT, 10) || 5432,
|
||||
port: parseInt(process.env.DATABASE_PORT || '5432', 10),
|
||||
username: process.env.DATABASE_USERNAME || 'postgres',
|
||||
password: process.env.DATABASE_PASSWORD || 'postgres',
|
||||
database: process.env.DATABASE_NAME || 'prism_messenger',
|
||||
|
@ -3,13 +3,13 @@ import { ConfigService } from '@nestjs/config';
|
||||
|
||||
export const getTypeOrmConfig = (configService: ConfigService): TypeOrmModuleOptions => ({
|
||||
type: 'postgres',
|
||||
host: configService.get('DATABASE_HOST') || 'localhost',
|
||||
port: configService.get('DATABASE_PORT') || 5432,
|
||||
username: configService.get('DATABASE_USERNAME') || 'postgres',
|
||||
password: configService.get('DATABASE_PASSWORD') || 'postgres',
|
||||
database: configService.get('DATABASE_NAME') || 'prism_messenger',
|
||||
host: configService.get<string>('DATABASE_HOST') || 'localhost',
|
||||
port: configService.get<number>('DATABASE_PORT') || 5432,
|
||||
username: configService.get<string>('DATABASE_USERNAME') || 'postgres',
|
||||
password: configService.get<string>('DATABASE_PASSWORD') || 'postgres',
|
||||
database: configService.get<string>('DATABASE_NAME') || 'prism_messenger',
|
||||
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
|
||||
migrations: [__dirname + '/../migrations/*{.ts,.js}'],
|
||||
synchronize: configService.get('NODE_ENV') !== 'production',
|
||||
logging: configService.get('NODE_ENV') !== 'production',
|
||||
synchronize: configService.get<string>('NODE_ENV') !== 'production',
|
||||
logging: configService.get<string>('NODE_ENV') !== 'production',
|
||||
});
|
@ -7,7 +7,7 @@ import { GqlAuthGuard } from '../auth/guards/gql-auth.guard';
|
||||
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
||||
import { User } from '../users/entities/user.entity';
|
||||
|
||||
const pubSub = new PubSub();
|
||||
const pubSub = new PubSub() as any;
|
||||
|
||||
@Resolver(() => Message)
|
||||
@UseGuards(GqlAuthGuard)
|
||||
|
@ -58,7 +58,7 @@ export class UsersService {
|
||||
async updateOnlineStatus(id: string, isOnline: boolean): Promise<void> {
|
||||
await this.usersRepository.update(id, {
|
||||
isOnline,
|
||||
lastSeen: isOnline ? null : new Date(),
|
||||
lastSeen: isOnline ? undefined : new Date(),
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user