Skip to content

Commit

Permalink
Merge pull request #63 from saessagMarket/feat/#62-product-bump-fix
Browse files Browse the repository at this point in the history
상품 조회 오류 및 끌어올리기 수정
  • Loading branch information
JunBe authored Jan 31, 2025
2 parents 69f3f9e + dad0b6a commit 3ff5e2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ public ApiResponse<Void> likeProduct(@PathVariable Long productId, @SessionAttri
}

@PostMapping("/bump")
public ApiResponse<?> bumpProduct(@RequestParam Long productId, HttpServletRequest session) {
SignInResponse signInResponse = (SignInResponse) session.getAttribute("user");
Product product = productService.bumpProduct(productId, signInResponse.getId());
public ApiResponse<?> bumpProduct(@RequestParam Long productId, @SessionAttribute(name = "user") SignInResponse user) {
Product product = productService.bumpProduct(productId, user.getId());
return ApiResponse.builder()
.status("200")
.data(product.getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public boolean deleteProduct(Long productId) {
public Page<ProductResponse> searchProducts(int page, int size, String title, String nickname, String sort) {
Sort sorting = (sort == null || sort.isEmpty()) ?
Sort.by(
Sort.Order.desc("dump_at").nullsLast(),
Sort.Order.desc("added_date")
Sort.Order.desc("bumpAt"),
Sort.Order.desc("addedDate")
) : Sort.by(Sort.Order.by(sort));

Pageable pageable = PageRequest.of(page, size, sorting);
Expand Down

0 comments on commit 3ff5e2b

Please sign in to comment.