Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 조직 링크 & 태그 도메인 delete 이전에 존재 여부 파악 로직 추가 #260

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public void updateOrganizationLink(Long organizationLinkId, OrganizationLinkUpda
}

public void deleteOrganizationLink(Long organizationLinkId) {
organizationLinkRepository.deleteById(organizationLinkId);
if (organizationLinkRepository.existsById(organizationLinkId)) {
organizationLinkRepository.deleteById(organizationLinkId);
} else {
throw new OrganizationLinkException(ORGANIZATION_LINK_NOT_FOUND);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import lombok.RequiredArgsConstructor;

import java.util.Optional;

@Transactional
@RequiredArgsConstructor
@Service
Expand All @@ -37,7 +39,11 @@ public TagCreateResponse createTag(Long organizationId, TagCreateRequest request
}

public void deleteTag(Long tagId) {
tagRepository.deleteById(tagId);
if (tagRepository.existsById(tagId)) {
tagRepository.deleteById(tagId);
} else {
throw new TagException(TAG_NOT_FOUND);
}
}

public void updateTag(Long tagId, TagUpdateRequest request) {
Expand Down
Loading