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