im profil kann ein nutzer nun seine daten exportieren. man kann seinen account löschen. nach 2 jahren werden inaktive accounts gelöscht, 1 monat vorher wird eine email geschickt. Hilfetexte und Legal Pages in der Guest PWA korrigiert und vom layout her optimiert (dark mode).
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\DataExport;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
@@ -43,6 +44,36 @@ class ProfileController extends Controller
|
||||
->values()
|
||||
->all();
|
||||
|
||||
$recentExports = $user->dataExports()
|
||||
->latest()
|
||||
->limit(5)
|
||||
->get()
|
||||
->map(fn ($export) => [
|
||||
'id' => $export->id,
|
||||
'status' => $export->status,
|
||||
'size' => $export->size_bytes,
|
||||
'expires_at' => optional($export->expires_at)->toIso8601String(),
|
||||
'created_at' => optional($export->created_at)->toIso8601String(),
|
||||
'download_url' => $export->isReady() && ! $export->hasExpired()
|
||||
? route('profile.data-exports.download', $export)
|
||||
: null,
|
||||
'error_message' => $export->error_message,
|
||||
]);
|
||||
|
||||
$pendingExport = $user->dataExports()
|
||||
->whereIn('status', [
|
||||
DataExport::STATUS_PENDING,
|
||||
DataExport::STATUS_PROCESSING,
|
||||
])
|
||||
->exists();
|
||||
|
||||
$lastReadyExport = $user->dataExports()
|
||||
->where('status', DataExport::STATUS_READY)
|
||||
->latest('created_at')
|
||||
->first();
|
||||
|
||||
$nextExportAt = $lastReadyExport?->created_at?->clone()->addDay();
|
||||
|
||||
return Inertia::render('Profile/Index', [
|
||||
'userData' => [
|
||||
'id' => $user->id,
|
||||
@@ -68,6 +99,11 @@ class ProfileController extends Controller
|
||||
] : null,
|
||||
] : null,
|
||||
'purchases' => $purchases,
|
||||
'dataExport' => [
|
||||
'exports' => $recentExports,
|
||||
'hasPending' => $pendingExport,
|
||||
'nextRequestAt' => $nextExportAt?->toIso8601String(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user