Skip to content

Commit

Permalink
Update ApiController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Sep 23, 2020
1 parent 5475ff5 commit 73827b3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Http/Controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace TypiCMS\Modules\History\Http\Controllers;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -45,12 +44,8 @@ public function index(Request $request): LengthAwarePaginator
return $data;
}

public function destroy(): JsonResponse
public function destroy()
{
$deleted = History::truncate();

return response()->json([
'error' => !$deleted,
]);
History::truncate();
}
}

0 comments on commit 73827b3

Please sign in to comment.