Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
4 changed files with 9 additions and 19 deletions
Showing only changes of commit 59446649f6 - Show all commits

View File

@ -1,12 +0,0 @@
{
"source": {
"directories": [
"src"
]
},
"timeout": 10,
"logs": {
"text": "build\/humbuglog.txt",
"json": "build\/humbug.json"
}
}

View File

@ -285,7 +285,7 @@ class Model {
} }
$transformed = $this->animeTransformer->transform($baseData); $transformed = $this->animeTransformer->transform($baseData);
$transformed['included'] = $baseData['included']; $transformed['included'] = JsonAPI::organizeIncluded($baseData['included']);
return $transformed; return $transformed;
} }

View File

@ -44,9 +44,7 @@ class AnimeListTransformer extends AbstractTransformer {
{ {
$map = [ $map = [
'id' => $item['mal_id'], 'id' => $item['mal_id'],
'data' => [ 'data' => []
'episode' => $item['data']['progress']
]
]; ];
$data =& $item['data']; $data =& $item['data'];
@ -55,6 +53,10 @@ class AnimeListTransformer extends AbstractTransformer {
{ {
switch($key) switch($key)
{ {
case 'progress':
$map['data']['episode'] = $value;
break;
case 'notes': case 'notes':
$map['data']['comments'] = $value; $map['data']['comments'] = $value;
break; break;

View File

@ -280,11 +280,11 @@ class Anime extends BaseController {
); );
} }
foreach($data['included'] as $included) if (array_key_exists('characters', $data['included']))
{ {
if ($included['type'] === 'characters') foreach($data['included']['characters'] as $id => $character)
{ {
$characters[$included['id']] = $included['attributes']; $characters[$id] = $character['attributes'];
} }
} }