From c624b51acde87f9cb14f6f8c72fd6557d451d191 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 1 Mar 2021 10:08:36 -0500 Subject: [PATCH] Fix null error on updating Anime or Manga --- src/AnimeClient/Controller/Anime.php | 4 +--- src/AnimeClient/Controller/Manga.php | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/AnimeClient/Controller/Anime.php b/src/AnimeClient/Controller/Anime.php index d56740a0..45cf24bc 100644 --- a/src/AnimeClient/Controller/Anime.php +++ b/src/AnimeClient/Controller/Anime.php @@ -228,7 +228,7 @@ final class Anime extends BaseController { $postData = $transformer->untransform($data); $fullResult = $this->model->updateLibraryItem(FormItem::from($postData)); - if ($fullResult['statusCode'] === 200 && $fullResult['body']['error'] === NULL) + if ($fullResult['statusCode'] === 200) { $this->setFlashMessage('Successfully updated.', 'success'); $this->cache->clear(); @@ -302,8 +302,6 @@ final class Anime extends BaseController { * View details of an anime * * @param string $id - * @throws ContainerException - * @throws NotFoundException * @throws InvalidArgumentException * @return void */ diff --git a/src/AnimeClient/Controller/Manga.php b/src/AnimeClient/Controller/Manga.php index 05e7719d..f52d629e 100644 --- a/src/AnimeClient/Controller/Manga.php +++ b/src/AnimeClient/Controller/Manga.php @@ -64,8 +64,6 @@ final class Manga extends Controller { * * @param string $status * @param string $view - * @throws ContainerException - * @throws NotFoundException * @throws InvalidArgumentException * @return void */ @@ -229,7 +227,7 @@ final class Manga extends Controller { $post_data = $transformer->untransform($data); $full_result = $this->model->updateLibraryItem(FormItem::from($post_data)); - if ($full_result['statusCode'] === 200 && $full_result['body']['error'] === NULL) + if ($full_result['statusCode'] === 200) { $this->setFlashMessage('Successfully updated manga.', 'success'); $this->cache->clear(); @@ -298,8 +296,6 @@ final class Manga extends Controller { * View details of an manga * * @param string $id - * @throws ContainerException - * @throws NotFoundException * @throws InvalidArgumentException * @throws Throwable * @return void @@ -331,8 +327,6 @@ final class Manga extends Controller { /** * View details of a random manga * - * @throws ContainerException - * @throws NotFoundException * @throws InvalidArgumentException * @throws Throwable * @return void