@@ -491,10 +491,10 @@ export class DeviceService {
491491 console . log ( 'Founded Device is:' , foundDevice ) ;
492492
493493 console . log (
494- `Device Node: ${ foundDevice . nodeId } ||| BackEnd Node: ${ process . env . NODE_ID } ` ,
494+ `Device Node: ${ foundDevice . nodeId } ||| BackEnd Node: ${ process . env . PANEL_URL } ` ,
495495 ) ;
496496
497- if ( String ( foundDevice . nodeId ) !== String ( process . env . NODE_ID ) ) {
497+ if ( String ( foundDevice . nodeId ) !== String ( process . env . PANEL_URL ) ) {
498498 let errorMessage = `You can't edit other nodes devices !` ;
499499 throw new GeneralException ( ErrorTypeEnum . FORBIDDEN , errorMessage ) ;
500500 }
@@ -513,7 +513,7 @@ export class DeviceService {
513513 } ;
514514 return this . result ;
515515 }
516- foundDevice . nodeId = String ( process . env . NODE_ID ) ;
516+ foundDevice . nodeId = String ( process . env . PANEL_URL ) ;
517517 foundDevice . updatedBy =
518518 String ( userId ) == 'root' ? foundDevice . updatedBy : userId ;
519519 foundDevice . updateDate = new Date ( ) ;
@@ -528,7 +528,7 @@ export class DeviceService {
528528 this . result = data ;
529529 if ( body . isShared == true && foundDevice . isShared == false ) {
530530 this . contractService . shareDevice (
531- String ( process . env . NODE_ID ) ,
531+ String ( process . env . PANEL_URL ) ,
532532 String ( newData . _id ) ,
533533 String ( newData . userId ) ,
534534 String ( newData . deviceName ) ,
@@ -549,7 +549,7 @@ export class DeviceService {
549549 newData . deviceEncryptedId ,
550550 ) ;
551551 this . contractService . removeSharedDevice (
552- process . env . NODE_ID ,
552+ process . env . PANEL_URL ,
553553 String ( newData . _id ) ,
554554 ) ;
555555 }
@@ -563,7 +563,7 @@ export class DeviceService {
563563 }
564564
565565 async updateAllDevices ( ) {
566- await this . deviceRepository . updateAllNodeIds ( process . env . NODE_ID ) ;
566+ await this . deviceRepository . updateAllNodeIds ( process . env . PANEL_URL ) ;
567567 }
568568
569569 async renameDevice ( body , userId , isAdmin = false ) : Promise < any > {
@@ -850,7 +850,7 @@ export class DeviceService {
850850 console . log ( 'Updated found device for deletion is: ' , foundDevice ) ;
851851
852852 this . contractService . removeSharedDevice (
853- process . env . NODE_ID ,
853+ process . env . PANEL_URL ,
854854 String ( foundDevice . _id ) ,
855855 ) ;
856856
@@ -899,7 +899,7 @@ export class DeviceService {
899899
900900 for ( const element of devices ) {
901901 this . contractService . removeSharedDevice (
902- process . env . NODE_ID ,
902+ process . env . PANEL_URL ,
903903 String ( element . _id ) ,
904904 ) ;
905905
0 commit comments