Partially fix #9 -- API calls fail on 'Plan to Watch' section
This commit is contained in:
parent
5563902b69
commit
ecf3bce14b
@ -3,6 +3,11 @@
|
||||
<h2>Add Anime to your Collection</h2>
|
||||
<form action="<?= $action_url ?>" method="post">
|
||||
<section>
|
||||
<div class="cssload-loader" hidden="hidden">
|
||||
<div class="cssload-inner cssload-one"></div>
|
||||
<div class="cssload-inner cssload-two"></div>
|
||||
<div class="cssload-inner cssload-three"></div>
|
||||
</div>
|
||||
<label for="search">Search for anime by name: <input type="search" id="search" name="search" /></label>
|
||||
<section id="series_list" class="media-wrap">
|
||||
</section>
|
||||
@ -34,11 +39,5 @@
|
||||
</table>
|
||||
</form>
|
||||
</main>
|
||||
<template id="show_list">
|
||||
<article class="media">
|
||||
<div class="name"><label><input type="radio" name="id" value="{{:id}}" /> <span>{{:title}}<br />{{:alternate_title}}</span></label></div>
|
||||
<img src="{{:cover_image}}" alt="{{:title}}" />
|
||||
</article>
|
||||
</template>
|
||||
<script src="<?= $urlGenerator->asset_url('js.php/g/anime_collection') ?>"></script>
|
||||
<?php endif ?>
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
namespace Aviat\AnimeClient\Controller;
|
||||
|
||||
use Aviat\Ion\Json;
|
||||
use Aviat\Ion\Di\ContainerInterface;
|
||||
use Aviat\AnimeClient\Controller;
|
||||
use Aviat\AnimeClient\Config;
|
||||
@ -194,9 +195,9 @@ class Manga extends Controller {
|
||||
$post_data = $transformer->untransform($post_data);
|
||||
$full_result = $this->model->update($post_data);
|
||||
|
||||
$result = $full_result['body'];
|
||||
$result = Json::decode((string)$full_result['body']);
|
||||
|
||||
if (array_key_exists('manga', $result))
|
||||
if ($full_result['statusCode'] == 200)
|
||||
{
|
||||
$m =& $result['manga'][0];
|
||||
$title = ( ! empty($m['english_title']))
|
||||
|
@ -50,6 +50,14 @@ class Manga extends API {
|
||||
*/
|
||||
protected $base_url = "https://hummingbird.me/";
|
||||
|
||||
/**
|
||||
* Make an authenticated manga API call
|
||||
*
|
||||
* @param string $type - the HTTP verb
|
||||
* @param string $url
|
||||
* @param string|null $json
|
||||
* @return array
|
||||
*/
|
||||
protected function _manga_api_call($type, $url, $json = NULL)
|
||||
{
|
||||
$token = $this->container->get('auth')
|
||||
|
Loading…
Reference in New Issue
Block a user