3 namespace BookStack\Http\Controllers\Api;
5 use BookStack\Actions\ActivityType;
6 use BookStack\Entities\Models\Deletion;
7 use BookStack\Entities\Repos\DeletionRepo;
8 use BookStack\Entities\Tools\TrashCan;
10 class RecycleBinApiController extends ApiController
12 public function __construct()
14 $this->middleware(function ($request, $next) {
15 $this->checkPermission('settings-manage');
16 $this->checkPermission('restrictions-manage-all');
18 return $next($request);
22 public function list()
24 return $this->apiListingResponse(Deletion::query(), [
34 public function restore(DeletionRepo $deletionRepo, string $id)
36 $restoreCount = $deletionRepo->restore((int) $id);
37 return response()->json(['restore_count' => $restoreCount]);
40 public function destroy(DeletionRepo $deletionRepo, string $id)
42 $deleteCount = $deletionRepo->destroy((int) $id);
43 return response()->json(['delete_count' => $deleteCount]);