관리자 태그 큐레이션 등록, 수정
- 태그가 #으로 시작하지 않으면 #추가
This commit is contained in:
@@ -20,7 +20,12 @@ class AdminHashTagCurationService(
|
||||
) {
|
||||
@Transactional
|
||||
fun createContentHashTagCuration(request: CreateContentHashTagCurationRequest) {
|
||||
val isExists = repository.isExistsTag(tag = request.tag.trim())
|
||||
var tag = request.tag.trim()
|
||||
if (!tag.startsWith("#")) {
|
||||
tag = "#$tag"
|
||||
}
|
||||
|
||||
val isExists = repository.isExistsTag(tag = tag)
|
||||
|
||||
if (isExists) {
|
||||
throw SodaException("이미 등록된 태그 입니다.")
|
||||
@@ -28,7 +33,7 @@ class AdminHashTagCurationService(
|
||||
|
||||
repository.save(
|
||||
ContentHashTagCuration(
|
||||
tag = request.tag,
|
||||
tag = tag,
|
||||
isAdult = request.isAdult
|
||||
)
|
||||
)
|
||||
@@ -40,7 +45,12 @@ class AdminHashTagCurationService(
|
||||
?: throw SodaException("잘못된 요청입니다.")
|
||||
|
||||
if (request.tag != null) {
|
||||
hashTagCuration.tag = request.tag
|
||||
var tag = request.tag.trim()
|
||||
if (!tag.startsWith("#")) {
|
||||
tag = "#$tag"
|
||||
}
|
||||
|
||||
hashTagCuration.tag = tag
|
||||
}
|
||||
|
||||
if (request.isAdult != null) {
|
||||
|
Reference in New Issue
Block a user