Skip to content

Commit

Permalink
VM-1501: conversation improvements 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-buravlev committed Nov 21, 2024
1 parent 29deff8 commit afa3b54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ public virtual async Task<CommunicationUserEntity> GetCommunicationUserByUserIdA
public virtual async Task<IList<ConversationEntity>> GetConversationsByIdsAsync(IList<string> ids, string responseGroup = null)
{
var result = Array.Empty<ConversationEntity>();
var respGroupEnum = EnumUtility.SafeParseFlags(responseGroup, ConversationResponseGroup.None);

if (!ids.IsNullOrEmpty())
{
result = await Conversations.Where(x => ids.Contains(x.Id)).ToArrayAsync();
result = await Conversations.Where(x => ids.Contains(x.Id)).Include(x => x.Users).ToArrayAsync();
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ protected override IQueryable<MessageEntity> BuildQuery(IRepository repository,
{
var query = ((ICommunicationRepository)repository).Messages;

if (!string.IsNullOrEmpty(criteria.ConversationId))
{
query = query.Where(x => x.ConversationId == criteria.ConversationId);
}
query = query.Where(x => x.ConversationId == criteria.ConversationId);

if (!string.IsNullOrEmpty(criteria.ThreadId))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,16 @@ public static TheoryData<string, string, bool, int> MessageSearchTestInput()
1
},
{
null,
null,
false,
3
},
{
null,
"TestConversationId_1",
"TestMessageId_1",
false,
1
},
{
null,
"TestConversationId_1",
null,
true,
2
1
}
};
}
Expand Down

0 comments on commit afa3b54

Please sign in to comment.