Skip to content

Commit 220254c

Browse files
committed
refactor: 부모 프로필 검증 함수 profileService 아래로 이동
1 parent 5f8b91a commit 220254c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/everTale/everTale_be/domain/profile/service/ProfileService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ public void deleteProfile(String accessToken){
152152
profileRepository.anonymizeProfile(profileId);
153153
}
154154

155+
public void isParent(Profile profile) {
156+
if (profile.getProfileType() != ProfileType.PARENT) {
157+
throw new UnAuthorizedHandler(ErrorStatus.UNAUTHORIZED_PROFILE_ACCESS);
158+
}
159+
}
160+
155161
public void validateChildProfileAccess(Profile profile, Long profileId) {
156162
if (!profile.getId().equals(profileId)) {
157163
throw new UnAuthorizedHandler(ErrorStatus.UNAUTHORIZED_PROFILE_ACCESS);

0 commit comments

Comments
 (0)