Skip to content

Commit

Permalink
renamed method params
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorovychh committed Jan 2, 2024
1 parent 984e759 commit 0cc2adb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@ public ShoppingCartResponseDto addToShoppingCart(Authentication authentication,
}

@PreAuthorize("hasRole('ROLE_USER')")
@PutMapping("/cart-items/{cartItemId}")
@PutMapping("/cart-items/{id}")
@Operation(
summary = "Update books quantity",
description = "Update quantity of a book in the shopping cart"
)
public ShoppingCartResponseDto updateById(
Authentication authentication,
@PathVariable Long cartItemId,
@PathVariable Long id,
@RequestBody @Valid PutCartItemRequestDto requestDto
) {
return shoppingCartService
.updateByCartId(authentication, cartItemId, requestDto);
.updateByCartId(authentication, id, requestDto);
}

@PreAuthorize("hasRole('ROLE_USER')")
@DeleteMapping("/cart-items/{cartItemId}")
@DeleteMapping("/cart-items/{id}")
@Operation(
summary = "Delete book from shopping cart",
description = "Delete book from shopping cart by id"
)
public void deleteItemFromShoppingCart(@PathVariable Long cartItemId) {
cartItemService.deleteCartItem(cartItemId);
public void deleteItemFromShoppingCart(@PathVariable Long id) {
cartItemService.deleteCartItem(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface CartItemService {

CartItemResponseDto updateById(Long id, int quantity);

void deleteCartItem(Long cartItemId);
void deleteCartItem(Long id);

CartItem addCartItem(ShoppingCart shoppingCart, ShoppingCartRequestDto requestDto);
}

0 comments on commit 0cc2adb

Please sign in to comment.