From 876323228a9906ed9eb3b5c483a156d50c2593d5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 18 Feb 2020 00:39:56 -0700 Subject: [PATCH] Update StoryItemTransformer --- app/Transformer/Api/StoryItemTransformer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Transformer/Api/StoryItemTransformer.php b/app/Transformer/Api/StoryItemTransformer.php index 3d10cb979..1fbd9c37d 100644 --- a/app/Transformer/Api/StoryItemTransformer.php +++ b/app/Transformer/Api/StoryItemTransformer.php @@ -12,14 +12,15 @@ class StoryItemTransformer extends Fractal\TransformerAbstract public function transform(StoryItem $item) { return [ - 'id' => (string) Str::uuid(), + 'id' => (string) $item->id, 'type' => $item->type, - 'length' => $item->duration, + 'length' => $item->duration != 0 ? $item->duration : 3, 'src' => $item->url(), 'preview' => null, 'link' => null, 'linkText' => null, - 'time' => $item->updated_at->format('U'), + 'time' => $item->created_at->format('U'), + 'expires_at' => $item->created_at->addHours(24)->format('U'), 'seen' => $item->story->seen(), ]; }