@@ -483,7 +483,6 @@ public function delete_by_uuid(Request $request)
483
483
]);
484
484
}
485
485
486
-
487
486
#[OA \Get(
488
487
summary: 'List Envs ' ,
489
488
description: 'List all envs by service UUID. ' ,
@@ -539,12 +538,11 @@ public function envs(Request $request)
539
538
return invalidTokenResponse ();
540
539
}
541
540
$ service = Service::whereRelation ('environment.project.team ' , 'id ' , $ teamId )->whereUuid ($ request ->uuid )->first ();
542
- if (!$ service ) {
541
+ if (! $ service ) {
543
542
return response ()->json (['message ' => 'Service not found. ' ], 404 );
544
543
}
545
- $ envs = $ service ->environment_variables ->sortBy ('id ' );
546
544
547
- $ envs = $ envs ->map (function ($ env ) {
545
+ $ envs = $ service -> environment_variables ->map (function ($ env ) {
548
546
$ env ->makeHidden ([
549
547
'application_id ' ,
550
548
'standalone_clickhouse_id ' ,
@@ -560,6 +558,8 @@ public function envs(Request $request)
560
558
561
559
return $ env ;
562
560
});
561
+
562
+ return response ()->json ($ envs );
563
563
}
564
564
565
565
#[OA \Patch(
@@ -642,7 +642,7 @@ public function update_env_by_uuid(Request $request)
642
642
}
643
643
644
644
$ service = Service::whereRelation ('environment.project.team ' , 'id ' , $ teamId )->whereUuid ($ request ->uuid )->first ();
645
- if (!$ service ) {
645
+ if (! $ service ) {
646
646
return response ()->json (['message ' => 'Service not found. ' ], 404 );
647
647
}
648
648
@@ -663,7 +663,7 @@ public function update_env_by_uuid(Request $request)
663
663
}
664
664
665
665
$ env = $ service ->environment_variables ()->where ('key ' , $ request ->key )->first ();
666
- if (!$ env ) {
666
+ if (! $ env ) {
667
667
return response ()->json (['message ' => 'Environment variable not found. ' ], 404 );
668
668
}
669
669
@@ -761,12 +761,12 @@ public function create_bulk_envs(Request $request)
761
761
}
762
762
763
763
$ service = Service::whereRelation ('environment.project.team ' , 'id ' , $ teamId )->whereUuid ($ request ->uuid )->first ();
764
- if (!$ service ) {
764
+ if (! $ service ) {
765
765
return response ()->json (['message ' => 'Service not found. ' ], 404 );
766
766
}
767
767
768
768
$ bulk_data = $ request ->get ('data ' );
769
- if (!$ bulk_data ) {
769
+ if (! $ bulk_data ) {
770
770
return response ()->json (['message ' => 'Bulk data is required. ' ], 400 );
771
771
}
772
772
@@ -876,7 +876,7 @@ public function create_env(Request $request)
876
876
}
877
877
878
878
$ service = Service::whereRelation ('environment.project.team ' , 'id ' , $ teamId )->whereUuid ($ request ->uuid )->first ();
879
- if (!$ service ) {
879
+ if (! $ service ) {
880
880
return response ()->json (['message ' => 'Service not found. ' ], 404 );
881
881
}
882
882
@@ -976,15 +976,15 @@ public function delete_env_by_uuid(Request $request)
976
976
}
977
977
978
978
$ service = Service::whereRelation ('environment.project.team ' , 'id ' , $ teamId )->whereUuid ($ request ->uuid )->first ();
979
- if (!$ service ) {
979
+ if (! $ service ) {
980
980
return response ()->json (['message ' => 'Service not found. ' ], 404 );
981
981
}
982
982
983
983
$ env = EnvironmentVariable::where ('uuid ' , $ request ->env_uuid )
984
984
->where ('service_id ' , $ service ->id )
985
985
->first ();
986
986
987
- if (!$ env ) {
987
+ if (! $ env ) {
988
988
return response ()->json (['message ' => 'Environment variable not found. ' ], 404 );
989
989
}
990
990
0 commit comments