This commit is contained in:
Andras Bacsai 2024-07-11 10:17:20 +02:00
parent deb4b16ae1
commit 3ae990aa40

View File

@ -683,6 +683,9 @@ private function create_application(Request $request, $type)
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validator = customApiValidator($request->all(), [
sharedDataApplications(),
'git_repository' => 'string|required',
@ -756,6 +759,9 @@ private function create_application(Request $request, $type)
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validator = customApiValidator($request->all(), [
sharedDataApplications(),
'git_repository' => 'string|required',
@ -847,6 +853,9 @@ private function create_application(Request $request, $type)
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validator = customApiValidator($request->all(), [
sharedDataApplications(),
'git_repository' => 'string|required',
@ -1268,11 +1277,8 @@ public function delete_by_uuid(Request $request)
if (is_null($teamId)) {
return invalidTokenResponse();
}
if ($request->collect()->count() == 0) {
return response()->json([
'message' => 'Invalid request.',
], 400);
if (! $request->uuid) {
return response()->json(['message' => 'UUID is required.'], 404);
}
$application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->uuid)->first();