feat: community.html dynamisch via API, GET /api/v1/profiles, follow/unfollow fix

This commit is contained in:
GeNii96 committed 2026-05-30 13:28:48 +02:00
1 parent cb11acd306
commit 4f7e9bac68
7 files changed
+188 -116

No files matched your search

@@ -26,8 +26,8 @@ namespace OnlyPrompt.Backend.Controllers
{
}
[HttpPut("{userId}/{level}")]
public async Task<Results<Ok, BadRequest<string>, NotFound<string>>> SubscribeAsync(Identifier subscribeToId, int? level = null)
[HttpPut("{userId}/{level?}")]
public async Task<Results<Ok, BadRequest<string>, NotFound<string>>> SubscribeAsync([FromRoute(Name = "userId")] Identifier subscribeToId, int? level = null)
{
var userId = User.GetUserId();
var subscribeTo = await _db.Users.Include(x => x.SubscriptionTiers.Where(st => st.Level == level))
@@ -86,7 +86,7 @@ namespace OnlyPrompt.Backend.Controllers
}
[HttpGet("{userId}")]
public async Task<ApiSubscription?> GetCurrentSubscriptionAsync(Identifier subscribeToId)
public async Task<ApiSubscription?> GetCurrentSubscriptionAsync([FromRoute(Name = "userId")] Identifier subscribeToId)
{
var userId = User.GetUserId();
var subscription = await _db.Subscriptions
@@ -101,7 +101,7 @@ namespace OnlyPrompt.Backend.Controllers
}
[HttpDelete("{userId}")]
public async Task<Results<Ok, NotFound<string>>> UnsubscribeAsync(Identifier subscribeToId)
public async Task<Results<Ok, NotFound<string>>> UnsubscribeAsync([FromRoute(Name = "userId")] Identifier subscribeToId)
{
var userId = User.GetUserId();
var count = await _db.Subscriptions