♻️ I have no idea what am I doing. Might be mixing stuff

This commit is contained in:
2025-07-14 19:55:28 +08:00
parent ef9175d27d
commit cbfdb4aa60
232 changed files with 990 additions and 115807 deletions

View File

@@ -30,7 +30,7 @@ public class PublisherSubscriptionController(
[Authorize]
public async Task<ActionResult<SubscriptionStatusResponse>> CheckSubscriptionStatus(string name)
{
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
// Check if the publisher exists
var publisher = await db.Publishers.FirstOrDefaultAsync(p => p.Name == name);
@@ -53,7 +53,7 @@ public class PublisherSubscriptionController(
string name,
[FromBody] SubscribeRequest request)
{
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
// Check if the publisher exists
var publisher = await db.Publishers.FirstOrDefaultAsync(p => p.Name == name);
@@ -81,7 +81,7 @@ public class PublisherSubscriptionController(
[Authorize]
public async Task<ActionResult> Unsubscribe(string name)
{
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
// Check if the publisher exists
var publisher = await db.Publishers.FirstOrDefaultAsync(e => e.Name == name);
@@ -104,7 +104,7 @@ public class PublisherSubscriptionController(
[Authorize]
public async Task<ActionResult<List<PublisherSubscription>>> GetCurrentSubscriptions()
{
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
var subscriptions = await subs.GetAccountSubscriptionsAsync(currentUser.Id);
return subscriptions;