Skip to content

Commit

Permalink
Merge pull request #22 from EWHA-CAPSTONE-COOKSAVE/feature/ingredient
Browse files Browse the repository at this point in the history
[차소연] 전체 재료 조회 시 재료 등록일 기준 최신순으로 정렬하여 조회
  • Loading branch information
Soyeon-Cha authored Apr 22, 2024
2 parents eea0114 + aad6806 commit d446073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@Repository
public interface IngredientRepository extends JpaRepository<Ingredient, Long> {
List<Ingredient> findAllByMember(Member member);
List<Ingredient> findAllByMemberOrderByIngredientIdDesc(Member member);
Long countAllByMember(Member member);
Optional<Ingredient> findByIngredientIdAndMember(Long ingredientId, Member member);
boolean existsByMemberAndTag(Member member, Tag tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class IngredientService {
// 전체 재료 조회
public List<IngredientResponseDto> getIngredientList(Member member) {
List<Ingredient> ingredients = new ArrayList<>();
ingredients = ingredientRepository.findAllByMember(member);
ingredients = ingredientRepository.findAllByMemberOrderByIngredientIdDesc(member);

List<IngredientResponseDto> ingredientList = new ArrayList<>();
for (Ingredient ingredient:ingredients){
Expand Down

0 comments on commit d446073

Please sign in to comment.