diff --git a/api/app/Repositories/UsersRepository.php b/api/app/Repositories/UsersRepository.php index 19ff62d..385e0b8 100644 --- a/api/app/Repositories/UsersRepository.php +++ b/api/app/Repositories/UsersRepository.php @@ -49,7 +49,7 @@ class UsersRepository implements UsersRepositoryInterface public function getRecipeHistory(int $userID, string $groupBy = 'day') { - $userRecipes = UsersRecipes::where('user_id', $userID)->get(); + $userRecipes = UsersRecipes::where('user_id', $userID)->orderByDesc('created_at')->get(); $recipeHistory = []; if ($groupBy == 'month') { $userRecipes = $userRecipes->groupBy(function ($d) {