Skip to content

Commit

Permalink
fix load more function
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Dec 5, 2024
1 parent 11141eb commit f29ccac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BE/Controllers/Chats/Chats/UserChatsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task<ActionResult<PagedResult<ChatsResponse>>> GetChats([FromQuery]
IQueryable<Chat> query = db.Chats
.Include(x => x.Model)
.Where(x => x.UserId == currentUser.Id && !x.IsDeleted)
.OrderByDescending(x => x.CreatedAt);
.OrderByDescending(x => x.Id);
if (!string.IsNullOrWhiteSpace(request.Query))
{
query = query.Where(x => x.Title.Contains(request.Query));
Expand Down
2 changes: 1 addition & 1 deletion src/FE/components/HomeContent/HomeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const HomeContent = () => {
});
let chatList = rows;
if (!modelList) {
chatList = rows.concat(chats);
chatList = chats.concat(rows);
}
dispatch({ field: 'chats', value: chatList });
if (modelList) {
Expand Down

0 comments on commit f29ccac

Please sign in to comment.