mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
feat: Enhance API endpoints with pagination and new subscription details for players
This commit is contained in:
@@ -191,6 +191,23 @@ public class ClubsController(ClubService clubs) : ControllerBase
|
||||
return Ok(playerSubs + clubSubs);
|
||||
}
|
||||
|
||||
[HttpGet("/subscription/details/{accountId:long}")]
|
||||
public async Task<IActionResult> SubscriptionDetails(long accountId)
|
||||
{
|
||||
var viewerId = this.CurrentPlayerId();
|
||||
var subscriberCount = await clubs.PlayerSubscriberCountAsync(accountId);
|
||||
var subscribedCount = await clubs.PlayerSubscribedCountAsync(accountId);
|
||||
var isSubscribed = viewerId is long viewer
|
||||
&& await clubs.IsSubscribedToPlayerAsync(viewer, accountId);
|
||||
return Ok(new
|
||||
{
|
||||
accountId,
|
||||
subscriberCount,
|
||||
subscribedCount,
|
||||
isSubscribed,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST endpoint the watch hits when the player taps "mark read".
|
||||
/// Idempotent — the upsert in the service quietly returns if a
|
||||
|
||||
Reference in New Issue
Block a user