Commit 98d8a962 authored by henrik.prangel's avatar henrik.prangel
Browse files

JUT-83 add order by created to fix wrong display order

parent a5296f10
......@@ -11,5 +11,5 @@ import org.springframework.stereotype.Repository;
@SuppressWarnings("unused")
@Repository
public interface MessageRepository extends JpaRepository<Message, Long> {
List<Message> findByChat_Id(Long id);
List<Message> findByChat_IdOrderByCreated(Long id);
}
......@@ -91,7 +91,7 @@ public class MessageService {
}
public List<MessageDTO> findByChatId(Long chatId) {
List<Message> byChat_id = messageRepository.findByChat_Id(chatId);
List<Message> byChat_id = messageRepository.findByChat_IdOrderByCreated(chatId);
return byChat_id.stream().map(messageMapper::toDto).collect(Collectors.toList());
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment