@@ -491,10 +491,10 @@ export class DeviceService {
491
491
console . log ( 'Founded Device is:' , foundDevice ) ;
492
492
493
493
console . log (
494
- `Device Node: ${ foundDevice . nodeId } ||| BackEnd Node: ${ process . env . NODE_ID } ` ,
494
+ `Device Node: ${ foundDevice . nodeId } ||| BackEnd Node: ${ process . env . PANEL_URL } ` ,
495
495
) ;
496
496
497
- if ( String ( foundDevice . nodeId ) !== String ( process . env . NODE_ID ) ) {
497
+ if ( String ( foundDevice . nodeId ) !== String ( process . env . PANEL_URL ) ) {
498
498
let errorMessage = `You can't edit other nodes devices !` ;
499
499
throw new GeneralException ( ErrorTypeEnum . FORBIDDEN , errorMessage ) ;
500
500
}
@@ -513,7 +513,7 @@ export class DeviceService {
513
513
} ;
514
514
return this . result ;
515
515
}
516
- foundDevice . nodeId = String ( process . env . NODE_ID ) ;
516
+ foundDevice . nodeId = String ( process . env . PANEL_URL ) ;
517
517
foundDevice . updatedBy =
518
518
String ( userId ) == 'root' ? foundDevice . updatedBy : userId ;
519
519
foundDevice . updateDate = new Date ( ) ;
@@ -528,7 +528,7 @@ export class DeviceService {
528
528
this . result = data ;
529
529
if ( body . isShared == true && foundDevice . isShared == false ) {
530
530
this . contractService . shareDevice (
531
- String ( process . env . NODE_ID ) ,
531
+ String ( process . env . PANEL_URL ) ,
532
532
String ( newData . _id ) ,
533
533
String ( newData . userId ) ,
534
534
String ( newData . deviceName ) ,
@@ -549,7 +549,7 @@ export class DeviceService {
549
549
newData . deviceEncryptedId ,
550
550
) ;
551
551
this . contractService . removeSharedDevice (
552
- process . env . NODE_ID ,
552
+ process . env . PANEL_URL ,
553
553
String ( newData . _id ) ,
554
554
) ;
555
555
}
@@ -563,7 +563,7 @@ export class DeviceService {
563
563
}
564
564
565
565
async updateAllDevices ( ) {
566
- await this . deviceRepository . updateAllNodeIds ( process . env . NODE_ID ) ;
566
+ await this . deviceRepository . updateAllNodeIds ( process . env . PANEL_URL ) ;
567
567
}
568
568
569
569
async renameDevice ( body , userId , isAdmin = false ) : Promise < any > {
@@ -850,7 +850,7 @@ export class DeviceService {
850
850
console . log ( 'Updated found device for deletion is: ' , foundDevice ) ;
851
851
852
852
this . contractService . removeSharedDevice (
853
- process . env . NODE_ID ,
853
+ process . env . PANEL_URL ,
854
854
String ( foundDevice . _id ) ,
855
855
) ;
856
856
@@ -899,7 +899,7 @@ export class DeviceService {
899
899
900
900
for ( const element of devices ) {
901
901
this . contractService . removeSharedDevice (
902
- process . env . NODE_ID ,
902
+ process . env . PANEL_URL ,
903
903
String ( element . _id ) ,
904
904
) ;
905
905
0 commit comments