Skip to content

Commit

Permalink
[PDS-205] feat: Compliant solution
Browse files Browse the repository at this point in the history
  • Loading branch information
dangnak2 committed Nov 26, 2023
1 parent 118fa0e commit 0523aa7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ public ResponseCustom<List<EquipmentCategoryRes>> getEquipmentCategories(
@Account User user

Check failure

Code scanning / SonarCloud

Persistent entities should not be used as arguments of "@RequestMapping" methods High

Replace this persistent entity with a simple POJO or DTO object. See more on SonarCloud
)
{
return ResponseCustom.OK(equipmentService.getEquipmentCategories());
return ResponseCustom.OK(equipmentService.getEquipmentCategories(user));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void deleteEquipment(Long equipmentId, User user) {
equipmentRepository.delete(equipment);
}

public List<EquipmentCategoryRes> getEquipmentCategories() {
public List<EquipmentCategoryRes> getEquipmentCategories(User user) {
List<EquipmentCategory> categories = equipmentCategoryRepository.findByIsEnable(true);
return categories.stream().map(EquipmentCategoryRes::toDto).collect(Collectors.toList());
}
Expand Down

0 comments on commit 0523aa7

Please sign in to comment.