Skip to content

Commit

Permalink
fix: product sort
Browse files Browse the repository at this point in the history
  • Loading branch information
nowgnas committed Jan 29, 2024
1 parent f7a3017 commit 5b3d70b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public Page<Product> findProductsByFlowerId(SearchData searchData, Pageable page
if (searchData.getCategory() != null)
query.addCriteria(Criteria.where("category.categoryId").is(searchData.getCategory()));

query.with(Sort.by(Order.asc("productPrice")));
query.with(Sort.by(Order.desc("createdAt")));
query.with(pageable);
List<Product> products = mongoTemplate.find(query, Product.class);
Expand Down

0 comments on commit 5b3d70b

Please sign in to comment.