Browse Source

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

Jean Sumara 5 năm trước cách đây
mục cha
commit
6991e9547a
1 tập tin đã thay đổi với 7 bổ sung4 xóa
  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)) {