1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Adds tests and few fixes.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
Abijeet
2018-09-15 21:05:51 +05:30
parent 25da4d9a8b
commit 54ca4487fa
17 changed files with 55 additions and 18 deletions

View File

@ -2,7 +2,6 @@
use Activity;
use BookStack\Exceptions\NotFoundException;
use BookStack\Exceptions\BadRequestException;
use BookStack\Repos\EntityRepo;
use BookStack\Repos\UserRepo;
use BookStack\Services\ExportService;
@ -480,7 +479,8 @@ class PageController extends Controller
// Check if its the latest revision, cannot delete latest revision.
if (intval($current->id) === intval($revId)) {
throw new BadRequestException("Cannot delete the current revision #{$revId}");
session()->flash('error', trans('entities.revision_cannot_delete_latest'));
return view('pages/revisions', ['page' => $page, 'book' => $page->book, 'current' => $page]);
}
$revision->delete();