fix: align backend APIs and upload flow
This commit is contained in:
@@ -29,6 +29,18 @@ namespace GroupService.Infrastructure.Reposities
|
||||
return await db.Groups.Where(x => x.GroupMaster == userId).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Group>> FindByMemberIdAsync(Guid userId)
|
||||
{
|
||||
var groupIds = db.GroupMembers
|
||||
.Where(member => member.UserId == userId)
|
||||
.Select(member => member.GroupId);
|
||||
|
||||
return await db.Groups
|
||||
.Where(group => groupIds.Contains(group.Id))
|
||||
.OrderByDescending(group => group.ModificationTime ?? group.CreationTime)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Group>> FindByNameAsync(string name)
|
||||
{
|
||||
return await db.Groups.Where(x => x.Name == name).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user