From 28990280ef5349540e586b3cac5aae7386f0d175 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 18 Oct 2024 04:34:35 -0600 Subject: [PATCH] Update AdminReportController --- .../Admin/AdminReportController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/Http/Controllers/Admin/AdminReportController.php b/app/Http/Controllers/Admin/AdminReportController.php index 3f7899f05..bdd1c33a4 100644 --- a/app/Http/Controllers/Admin/AdminReportController.php +++ b/app/Http/Controllers/Admin/AdminReportController.php @@ -1593,6 +1593,25 @@ trait AdminReportController 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) { $this->validate($request, [