diff --git a/linkmind/src/main/java/com/app/toaster/infrastructure/CategoryRepository.java b/linkmind/src/main/java/com/app/toaster/infrastructure/CategoryRepository.java index 8da9bc9c..0b29c63b 100644 --- a/linkmind/src/main/java/com/app/toaster/infrastructure/CategoryRepository.java +++ b/linkmind/src/main/java/com/app/toaster/infrastructure/CategoryRepository.java @@ -64,7 +64,7 @@ void increasePriorityByOne(@Param("categoryId") Long categoryId, Long countAllByUser(User user); - Long countAllByTitleAndUser(String title); + Long countAllByTitleAndUser(String title, User user); diff --git a/linkmind/src/main/java/com/app/toaster/service/category/CategoryService.java b/linkmind/src/main/java/com/app/toaster/service/category/CategoryService.java index e3aecab9..0863ffdf 100644 --- a/linkmind/src/main/java/com/app/toaster/service/category/CategoryService.java +++ b/linkmind/src/main/java/com/app/toaster/service/category/CategoryService.java @@ -57,7 +57,7 @@ public void createCategory(final Long userId, final CreateCategoryDto createCate Error.BAD_REQUEST_CREATE_CLIP_EXCEPTION.getMessage()); } - if(categoryRepository.countAllByTitleAndUser(createCategoryDto.categoryTitle())>0){ + if(categoryRepository.countAllByTitleAndUser(createCategoryDto.categoryTitle(),presentUser)>0){ throw new CustomException(Error.UNPROCESSABLE_CREATE_TIMER_EXCEPTION, Error.UNPROCESSABLE_CREATE_TIMER_EXCEPTION.getMessage()); }