diff --git a/src/main/java/CookSave/CookSaveback/Ingredient/repository/IngredientRepository.java b/src/main/java/CookSave/CookSaveback/Ingredient/repository/IngredientRepository.java index 77769f6..8537bab 100644 --- a/src/main/java/CookSave/CookSaveback/Ingredient/repository/IngredientRepository.java +++ b/src/main/java/CookSave/CookSaveback/Ingredient/repository/IngredientRepository.java @@ -13,6 +13,7 @@ @Repository public interface IngredientRepository extends JpaRepository { List findAllByMember(Member member); + List findAllByMemberOrderByIngredientIdDesc(Member member); Long countAllByMember(Member member); Optional findByIngredientIdAndMember(Long ingredientId, Member member); boolean existsByMemberAndTag(Member member, Tag tag); diff --git a/src/main/java/CookSave/CookSaveback/Ingredient/service/IngredientService.java b/src/main/java/CookSave/CookSaveback/Ingredient/service/IngredientService.java index f636e7b..bc981cf 100644 --- a/src/main/java/CookSave/CookSaveback/Ingredient/service/IngredientService.java +++ b/src/main/java/CookSave/CookSaveback/Ingredient/service/IngredientService.java @@ -28,7 +28,7 @@ public class IngredientService { // 전체 재료 조회 public List getIngredientList(Member member) { List ingredients = new ArrayList<>(); - ingredients = ingredientRepository.findAllByMember(member); + ingredients = ingredientRepository.findAllByMemberOrderByIngredientIdDesc(member); List ingredientList = new ArrayList<>(); for (Ingredient ingredient:ingredients){