Skip to content

Commit

Permalink
v1.2.1 (#664)
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
xodms0309 authored Sep 18, 2023
2 parents 8a8e042 + 6a2d81f commit 70ac84e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
12 changes: 12 additions & 0 deletions backend/src/main/java/com/funeat/product/domain/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.funeat.member.domain.bookmark.ProductBookmark;
import com.funeat.review.domain.Review;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
Expand Down Expand Up @@ -42,6 +44,8 @@ public class Product {
@OneToMany(mappedBy = "product")
private List<ProductBookmark> productBookmarks;

private Long reviewCount = 0L;

protected Product() {
}

Expand Down Expand Up @@ -106,4 +110,12 @@ public Double getAverageRating() {
public Category getCategory() {
return category;
}

public Long getReviewCount() {
return reviewCount;
}

public void addReviewCount() {
reviewCount++;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void create(final Long productId, final Long memberId, final MultipartFil
final Long countByProduct = reviewRepository.countByProduct(findProduct);

findProduct.updateAverageRating(savedReview.getRating(), countByProduct);
findProduct.addReviewCount();
reviewTagRepository.saveAll(reviewTags);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ProductList = ({ category, selectedOption }: ProductListProps) => {
</li>
))}
</ProductListContainer>
<div ref={scrollRef} aria-hidden />
<div ref={scrollRef} aria-hidden style={{ height: '1px' }} />
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ProductTitleContainer = styled.div`
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 30px;
`;

const ProductTitleLink = styled(Link)`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Recipe/RecipeList/RecipeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const RecipeList = ({ selectedOption }: RecipeListProps) => {
</li>
))}
</RecipeListContainer>
<div ref={scrollRef} aria-hidden />
<div ref={scrollRef} aria-hidden style={{ height: '1px' }} />
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/common/useIntersectionObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRef, useEffect } from 'react';
const defaultOptions = {
root: null,
rootMargin: '0px',
threshold: 1.0,
threshold: 0.3,
};

const useIntersectionObserver = <T extends HTMLElement>(
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/RecipePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const TitleWrapper = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
height: 30px;
`;

const Title = styled(Heading)`
Expand All @@ -106,7 +107,7 @@ const SortButtonWrapper = styled.div`
`;

const RecipeListWrapper = styled.div`
height: calc(100% - 192px);
height: calc(100% - 190px);
overflow-y: auto;
`;

Expand Down

0 comments on commit 70ac84e

Please sign in to comment.