Bladeren bron

Merge branch 'hotfix-validation-api' into 'master'

Inserted validation with profile of tenancy

See merge request interlink-sa/flowdat3/modules/api!4
Jean Sumara Leopoldo 5 jaren geleden
bovenliggende
commit
252b2d9b79
2 gewijzigde bestanden met toevoegingen van 6 en 2 verwijderingen
  1. 2 1
      .gitignore
  2. 4 1
      src/Swagger/Client/FTTH/Services.php

+ 2 - 1
.gitignore

@@ -5,4 +5,5 @@
 !var/cache/.gitkeep
 !/var/logs
 /var/logs/*
-!var/logs/.gitkeep
+!var/logs/.gitkeep
+.idea

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

@@ -782,8 +782,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) {
                                             $content = "El id del profile no existe.";
+                                        }else if($profileValid['tenancyId'] !== $instance->getTenancyId()){
+                                            $content = "El perfil especificado no es propiedad de tenancia.";
                                         }
                                     }
                                     if (is_null($content)) {