a ton 👷‍♂️

This commit is contained in:
Andras Bacsai
2023-05-24 14:26:50 +02:00
parent 8677b1d85d
commit 6e7ee0ca48
67 changed files with 754 additions and 992 deletions

View File

@@ -81,7 +81,7 @@ Route::middleware(['auth'])->group(function () {
if ($is_new_project) {
$project = Project::create([
'name' => request()->query('name') ?? generateRandomName(),
'name' => request()->query('name') ?? generate_random_name(),
'team_id' => $id,
]);
return response()->json([
@@ -92,7 +92,7 @@ Route::middleware(['auth'])->group(function () {
$environment = Project::where('uuid', request()->query('project'))->first()->environments->where('name', request()->query('name'))->first();
if (!$environment) {
$environment = Environment::create([
'name' => request()->query('name') ?? generateRandomName(),
'name' => request()->query('name') ?? generate_random_name(),
'project_id' => Project::where('uuid', request()->query('project'))->first()->id,
]);
}
@@ -104,7 +104,7 @@ Route::middleware(['auth'])->group(function () {
'magic' => true,
]);
} catch (\Throwable $e) {
return generalErrorHandler($e, isJson: true);
return general_error_handler($e, isJson: true);
}
});
Route::get('/', function () {

View File

@@ -1,6 +1,6 @@
<?php
use App\Jobs\DeployApplicationJob;
use App\Jobs\ApplicationDeploymentJob;
use App\Models\Application;
use App\Models\PrivateKey;
use App\Models\GithubApp;
@@ -36,7 +36,7 @@ Route::get('/source/github/redirect', function () {
$github_app->save();
return redirect()->route('source.github.show', ['github_app_uuid' => $github_app->uuid]);
} catch (\Exception $e) {
return generalErrorHandler($e);
return general_error_handler($e);
}
});
@@ -52,7 +52,7 @@ Route::get('/source/github/install', function () {
}
return redirect()->route('source.github.show', ['github_app_uuid' => $github_app->uuid]);
} catch (\Exception $e) {
return generalErrorHandler($e);
return general_error_handler($e);
}
});
Route::post('/source/github/events', function () {
@@ -97,7 +97,7 @@ Route::post('/source/github/events', function () {
foreach ($applications as $application) {
if ($application->isDeployable()) {
$deployment_uuid = new Cuid2(7);
dispatch(new DeployApplicationJob(
dispatch(new ApplicationDeploymentJob(
deployment_uuid: $deployment_uuid,
application_uuid: $application->uuid,
force_rebuild: false,
@@ -105,6 +105,6 @@ Route::post('/source/github/events', function () {
}
}
} catch (\Exception $e) {
return generalErrorHandler($e);
return general_error_handler($e);
}
});