- if (intval($current->id) === intval($revId)) {
- throw new BadRequestException("Cannot delete the current revision #{$revId}");
+ if (intval($currentRevision->id) === intval($revId)) {
+ session()->flash('error', trans('entities.revision_cannot_delete_latest'));
+ return response()->view('pages/revisions', ['page' => $page, 'book' => $page->book, 'current' => $page], 400);