too many changes
This commit is contained in:
@@ -32,6 +32,16 @@ public sealed class CollectionRepository : ICollectionRepository
|
||||
.ToListAsync(ct);
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<Collection>> GetByMemberAsync(long telegramId, CancellationToken ct)
|
||||
{
|
||||
return await _db.Collections
|
||||
.Include(c => c.Members)
|
||||
.Where(c => c.Members.Any(m => m.TelegramId == telegramId))
|
||||
.OrderBy(x => x.IsInbox ? 0 : 1) // Inbox всегда первым
|
||||
.ThenBy(x => x.Name)
|
||||
.ToListAsync(ct);
|
||||
}
|
||||
|
||||
public Task<Collection?> GetInboxAsync(long ownerTelegramId, CancellationToken ct) =>
|
||||
_db.Collections
|
||||
.Include(c => c.Members)
|
||||
|
||||
Reference in New Issue
Block a user