mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 20:22:18 +00:00
Fixed failing tests
Fixed syntax error in french translations. Removed 'required' on image validation which was breaking tests
This commit is contained in:
parent
5ad9c5d319
commit
3df7d828eb
@ -120,7 +120,7 @@ class ImageController extends Controller
|
|||||||
{
|
{
|
||||||
$this->checkPermission('image-create-all');
|
$this->checkPermission('image-create-all');
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'file' => 'required|image'
|
'file' => 'is_image'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$this->imageRepo->isValidType($type)) {
|
if (!$this->imageRepo->isValidType($type)) {
|
||||||
@ -136,6 +136,7 @@ class ImageController extends Controller
|
|||||||
return response($e->getMessage(), 500);
|
return response($e->getMessage(), 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return response()->json($image);
|
return response()->json($image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
// Custom validation methods
|
// Custom validation methods
|
||||||
Validator::extend('image', function ($attribute, $value, $parameters, $validator) {
|
Validator::extend('is_image', function ($attribute, $value, $parameters, $validator) {
|
||||||
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
|
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
|
||||||
return in_array($value->getMimeType(), $imageMimes);
|
return in_array($value->getMimeType(), $imageMimes);
|
||||||
});
|
});
|
||||||
|
@ -63,7 +63,7 @@ return [
|
|||||||
'search_created_before' => 'Créé avant',
|
'search_created_before' => 'Créé avant',
|
||||||
'search_created_after' => 'Créé après',
|
'search_created_after' => 'Créé après',
|
||||||
'search_set_date' => 'Choisir la date',
|
'search_set_date' => 'Choisir la date',
|
||||||
'search_update' => 'Actualiser la recherche'
|
'search_update' => 'Actualiser la recherche',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Books
|
* Books
|
||||||
|
Loading…
Reference in New Issue
Block a user