Ver Fonte

feat: Add current country field to device entity

x1ongzhu há 1 ano atrás
pai
commit
458eb884b5

+ 3 - 0
src/device/entities/device.entity.ts

@@ -31,4 +31,7 @@ export class Device {
 
     @Column({ type: 'text', nullable: true })
     clashProfile: string
+
+    @Column({ nullable: true })
+    currentCountry: string
 }

+ 1 - 1
src/events/events.gateway.ts

@@ -54,7 +54,7 @@ export class EventsGateway implements OnGatewayInit, OnGatewayConnection, OnGate
 
     @SubscribeMessage('message')
     handleEvent(client: Socket, data: any) {
-        // Logger.log(`Client ${client.id} sent: ${JSON.stringify(data)}`, 'EventsGateway')
+        Logger.log(`Client ${client.id} sent: ${JSON.stringify(data)}`, 'EventsGateway')
         if ('updateDevice' === data.action) {
             data.data.online = true
             this.deviceService.updateDevice(client.id, data.data)

+ 1 - 1
src/operator_config/operator_config.controller.ts

@@ -10,7 +10,7 @@ export class OperaterConfigController {
 
     @Post('/')
     async findAll(@Body() page: PageRequest<OperatorConfig>) {
-        if ((page.search as any).where.area) {
+        if ((page.search as any)?.where?.area) {
             (page.search as any).where.area = Like(`${(page.search as any).where.area}%`)
         }
         return await this.operatorConfigService.findAll(page)