Update AdminReportController

This commit is contained in:
Daniel Supernault 2024-10-18 04:34:35 -06:00
parent b464eee966
commit 28990280ef
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -1593,6 +1593,25 @@ trait AdminReportController
return new AdminModeratedProfileResource($profile); return new AdminModeratedProfileResource($profile);
} }
public function exportModeratedProfiles(Request $request)
{
return response()->streamDownload(function () {
$profiles = ModeratedProfile::get();
$res = AdminModeratedProfileResource::collection($profiles);
echo json_encode([
'_pixelfed_export' => true,
'meta' => [
'ns' => 'https://pixelfed.org',
'origin' => config('pixelfed.domain.app'),
'date' => now()->format('c'),
'type' => 'moderated-profiles',
'version' => "1.0"
],
'data' => $res
], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
}, 'data-export.json');
}
public function deleteModeratedProfile(Request $request) public function deleteModeratedProfile(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [