diff --git a/DysonNetwork.Pass/Account/RelationshipController.cs b/DysonNetwork.Pass/Account/RelationshipController.cs index bcd57830..fa010ddc 100644 --- a/DysonNetwork.Pass/Account/RelationshipController.cs +++ b/DysonNetwork.Pass/Account/RelationshipController.cs @@ -38,14 +38,17 @@ public class RelationshipController(AppDatabase db, RelationshipService rls) : C [HttpGet("requests")] [Authorize] - public async Task>> ListSentRequests() + public async Task>> ListRelationshipRequests() { if (HttpContext.Items["CurrentUser"] is not SnAccount currentUser) return Unauthorized(); var relationships = await db.AccountRelationships - .Where(r => r.AccountId == currentUser.Id && r.Status == RelationshipStatus.Pending) + .Where(r => r.Status == RelationshipStatus.Pending) + .Where(r => r.AccountId == currentUser.Id || r.RelatedId == currentUser.Id) .Include(r => r.Related) .ThenInclude(a => a.Profile) + .Include(r => r.Account) + .ThenInclude(a => a.Profile) .ToListAsync(); return relationships;