X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/d5b922aa50236c047904e94ca38b62026af4bb68..refs/pull/1025/head:/app/Http/Controllers/ImageController.php diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php index 277c27069..eb92ae9a8 100644 --- a/app/Http/Controllers/ImageController.php +++ b/app/Http/Controllers/ImageController.php @@ -164,32 +164,6 @@ class ImageController extends Controller return response()->json($image); } - /** - * Replace the data content of a drawing. - * @param string $id - * @param Request $request - * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\JsonResponse|\Symfony\Component\HttpFoundation\Response - */ - public function replaceDrawing(string $id, Request $request) - { - $this->validate($request, [ - 'image' => 'required|string' - ]); - $this->checkPermission('image-create-all'); - - $imageBase64Data = $request->get('image'); - $image = $this->imageRepo->getById($id); - $this->checkOwnablePermission('image-update', $image); - - try { - $image = $this->imageRepo->replaceDrawingContent($image, $imageBase64Data); - } catch (ImageUploadException $e) { - return response($e->getMessage(), 500); - } - - return response()->json($image); - } - /** * Get the content of an image based64 encoded. * @param $id @@ -261,6 +235,7 @@ class ImageController extends Controller * Deletes an image and all thumbnail/image files * @param int $id * @return \Illuminate\Http\JsonResponse + * @throws \Exception */ public function destroy($id) {