Initial Commit
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s

This commit is contained in:
2026-08-28 23:53:45 +10:00
parent 3ce70b3701
commit 37ff8e0a88
13 changed files with 292 additions and 23 deletions
+29
View File
@@ -69,4 +69,33 @@ class StoryController extends Controller
Story::where('id', $id)->update(['viewed_at' => now()]);
return response()->json(['ok' => true]);
}
/**
* Fetch a single story item by its own id, regardless of whether it's
* still active used for opening a story someone shared in a DM long
* after it expired from the live tray.
*/
public function showItem(string $id): JsonResponse
{
$item = Story::find($id);
if (! $item) {
return response()->json(['message' => 'Story not found.'], 404);
}
return response()->json([
'username' => $item->username,
'profile_pic_url' => $item->profile_pic_url,
'start_index' => 0,
'items' => [[
'id' => $item->id,
'code' => $item->code,
'is_video' => $item->is_video,
'image_url' => $item->image_url,
'video_url' => $item->video_url,
'accessibility_caption' => $item->accessibility_caption,
'taken_at' => $item->taken_at,
]],
]);
}
}