Update StoryTransformer

pull/2036/head
Daniel Supernault 2020-02-18 00:40:37 -07:00
rodzic 876323228a
commit 4c332ce700
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -16,19 +16,16 @@ class StoryTransformer extends Fractal\TransformerAbstract
return [
'id' => (string) $story->id,
'photo' => $story->profile->avatarUrl(),
'name' => '',
'link' => '',
'name' => $story->profile->username,
'link' => $story->profile->url(),
'lastUpdated' => $story->updated_at->format('U'),
'seen' => $story->seen(),
'items' => [],
];
}
public function includeItems(Story $story)
{
$items = $story->items;
return $this->collection($items, new StoryItemTransformer());
return $this->item($story, new StoryItemTransformer());
}
}