Quellcode durchsuchen

Merge branch 'hotfix-fix-onu-add' into 'master'

Fixed validation when i add new onu or put a onu exist

See merge request interlink-sa/flowdat3/modules/api!5
Jean Sumara Leopoldo vor 5 Jahren
Ursprung
Commit
54ec90581b
1 geänderte Dateien mit 7 neuen und 4 gelöschten Zeilen
  1. 7 4
      src/Swagger/Client/FTTH/Services.php

+ 7 - 4
src/Swagger/Client/FTTH/Services.php

@@ -783,10 +783,10 @@ class Services extends ApiServices
                                 if (is_null($content)) {
                                     if (!is_null($instance->getProfile())) {
                                         $profileValid = $apiValidationFTTH->validProfile($instance->getProfile());
-                                        if (!$profileValid) {
+                                        if (!$profileValid && $instance->getProfile() != 1) {
                                             $content = "El id del profile no existe.";
-                                        }else if($profileValid['tenancyId'] !== $instance->getTenancyId()){
-                                            $content = "El perfil especificado no es propiedad de tenancia.";
+                                        }else if($profileValid->getTenancyId() != $instance->getTenancyId()){
+                                            $content = "El perfil especificado no es propiedad de tenancy.";
                                         }
                                     }
                                     if (is_null($content)) {
@@ -947,8 +947,11 @@ class Services extends ApiServices
                                 }
                                 if (is_null($content)) {
                                     if (!is_null($instance->getProfile())) {
-                                        if (!$apiValidationFTTH->validProfile($instance->getProfile())) {
+                                        $profileValid = $apiValidationFTTH->validProfile($instance->getProfile());
+                                        if (!$profileValid && $instance->getProfile() != 1) {
                                             $content = "El id del profile no existe.";
+                                        }else if($profileValid->getTenancyId() != $instance->getTenancyId()){
+                                            $content = "El perfil especificado no es propiedad de tenancy.";
                                         }
                                     }
                                     if (is_null($content)) {