fix: cleanup parameter
This commit is contained in:
parent
2b805f869a
commit
574bafd950
@ -1283,7 +1283,7 @@ public function application_by_uuid(Request $request)
|
|||||||
public function delete_by_uuid(Request $request)
|
public function delete_by_uuid(Request $request)
|
||||||
{
|
{
|
||||||
$teamId = getTeamIdFromToken();
|
$teamId = getTeamIdFromToken();
|
||||||
$cleanup = $request->query->get('cleanup') ?? true;
|
$cleanup = filter_var($request->query->get('cleanup', true), FILTER_VALIDATE_BOOLEAN);
|
||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
return invalidTokenResponse();
|
return invalidTokenResponse();
|
||||||
}
|
}
|
||||||
@ -1297,7 +1297,10 @@ public function delete_by_uuid(Request $request)
|
|||||||
'message' => 'Application not found',
|
'message' => 'Application not found',
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
DeleteResourceJob::dispatch($application, deleteConfigurations: $cleanup, deleteVolumes: $cleanup);
|
DeleteResourceJob::dispatch(
|
||||||
|
resource: $application,
|
||||||
|
deleteConfigurations: $cleanup,
|
||||||
|
deleteVolumes: $cleanup);
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'Application deletion request queued.',
|
'message' => 'Application deletion request queued.',
|
||||||
|
@ -1572,7 +1572,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||||||
public function delete_by_uuid(Request $request)
|
public function delete_by_uuid(Request $request)
|
||||||
{
|
{
|
||||||
$teamId = getTeamIdFromToken();
|
$teamId = getTeamIdFromToken();
|
||||||
$cleanup = $request->query->get('cleanup') ?? true;
|
$cleanup = filter_var($request->query->get('cleanup', true), FILTER_VALIDATE_BOOLEAN);
|
||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
return invalidTokenResponse();
|
return invalidTokenResponse();
|
||||||
}
|
}
|
||||||
@ -1583,7 +1583,10 @@ public function delete_by_uuid(Request $request)
|
|||||||
if (! $database) {
|
if (! $database) {
|
||||||
return response()->json(['message' => 'Database not found.'], 404);
|
return response()->json(['message' => 'Database not found.'], 404);
|
||||||
}
|
}
|
||||||
DeleteResourceJob::dispatch($database, deleteConfigurations: $cleanup, deleteVolumes: $cleanup);
|
DeleteResourceJob::dispatch(
|
||||||
|
resource: $database,
|
||||||
|
deleteConfigurations: $cleanup,
|
||||||
|
deleteVolumes: $cleanup);
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'Database deletion request queued.',
|
'message' => 'Database deletion request queued.',
|
||||||
|
@ -28,7 +28,10 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
public function __construct(public Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource, public bool $deleteConfigurations = false, public bool $deleteVolumes = false) {}
|
public function __construct(
|
||||||
|
public Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource,
|
||||||
|
public bool $deleteConfigurations = false,
|
||||||
|
public bool $deleteVolumes = false) {}
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user