fix: change default sort for archive to newest-first

This commit is contained in:
Floorb 2023-06-01 15:18:44 -04:00
parent ee5148ab7b
commit ea09c62dc6
2 changed files with 2 additions and 1 deletions

View file

@ -30,7 +30,7 @@ if (!empty($_GET['q']) && is_string($_GET['q'])) {
});
}
$pastes = $pastes->get();
$pastes = $pastes->orderBy('id', 'desc')->get();
header('Content-Type: application/json; charset=UTF-8');

View file

@ -45,6 +45,7 @@ if (!empty($filter_value)) {
}
}
$pastes = $pastes->orderBy('id', 'desc');
$total_results = $pastes->count();
$pastes = $pastes->limit($per_page)->offset($per_page * $current_page);