Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #101 from FH-SWE-2023/fix/postorder
Browse files Browse the repository at this point in the history
Logbuch: Posts chronologisch anzeigen
  • Loading branch information
IsAvaible authored Jan 4, 2024
2 parents fb27d18 + 520fc0a commit 22e408a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/database/entities/Post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class Post {
// Retrieve all Posts from the database.
static Future<List<Post>> getAll() async {
final db = await DatabaseConnector.database;
final List<Map<String, dynamic>> maps = await db.query('posts', limit: 500);
final List<Map<String, dynamic>> maps =
await db.query('posts', limit: 500, orderBy: 'date desc');

return List.generate(maps.length, (i) {
return Post.fromMap(maps[i]);
Expand Down

0 comments on commit 22e408a

Please sign in to comment.