mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update StoryTransformer
This commit is contained in:
parent
876323228a
commit
4c332ce700
1 changed files with 3 additions and 6 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue