Code Styling
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Domains\Admin\Controllers;
|
||||
|
||||
use App\Models\Tenant;
|
||||
use App\Domains\Admin\Actions\UpdateTenantImpress\UpdateTenantImpressAction;
|
||||
use App\Domains\Admin\Actions\UpdateTenantImpress\UpdateTenantImpressRequest;
|
||||
use App\Scopes\CommonController;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -11,15 +12,18 @@ class ManagedTenantImpressUpdateController extends CommonController
|
||||
{
|
||||
public function __invoke(string $slug, Request $request): JsonResponse
|
||||
{
|
||||
$tenant = Tenant::where('slug', $slug)->firstOrFail();
|
||||
$tenant = $this->adminTenants->findBySlug($slug);
|
||||
|
||||
$tenant->update([
|
||||
'impress_text' => $request->input('impress_text'),
|
||||
]);
|
||||
$action = new UpdateTenantImpressAction(new UpdateTenantImpressRequest(
|
||||
tenant: $tenant,
|
||||
impressText: $request->input('impress_text'),
|
||||
));
|
||||
|
||||
$response = $action->execute();
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Impressum wurde gespeichert.',
|
||||
'status' => $response->success ? 'success' : 'error',
|
||||
'message' => $response->message,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user