mirror of https://github.com/pixelfed/pixelfed.git
Update StoryTransformer
This commit is contained in:
parent
876323228a
commit
4c332ce700
|
@ -16,19 +16,16 @@ class StoryTransformer extends Fractal\TransformerAbstract
|
||||||
return [
|
return [
|
||||||
'id' => (string) $story->id,
|
'id' => (string) $story->id,
|
||||||
'photo' => $story->profile->avatarUrl(),
|
'photo' => $story->profile->avatarUrl(),
|
||||||
'name' => '',
|
'name' => $story->profile->username,
|
||||||
'link' => '',
|
'link' => $story->profile->url(),
|
||||||
'lastUpdated' => $story->updated_at->format('U'),
|
'lastUpdated' => $story->updated_at->format('U'),
|
||||||
'seen' => $story->seen(),
|
'seen' => $story->seen(),
|
||||||
'items' => [],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includeItems(Story $story)
|
public function includeItems(Story $story)
|
||||||
{
|
{
|
||||||
$items = $story->items;
|
return $this->item($story, new StoryItemTransformer());
|
||||||
|
|
||||||
return $this->collection($items, new StoryItemTransformer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue