git commit -m "fix(chat): 캐릭터 등록/수정 API

- 이름 중복 검사 로직 추가
This commit is contained in:
2025-08-06 22:19:52 +09:00
parent 5132a6b9fa
commit 45b6c8db96
2 changed files with 23 additions and 3 deletions

View File

@@ -292,7 +292,10 @@ class ChatCharacterService(
// isActive가 false이면 isActive = false, name = "inactive_$name"으로 변경하고 나머지는 반영하지 않는다.
if (request.isActive != null && !request.isActive) {
chatCharacter.isActive = false
chatCharacter.name = "inactive_${chatCharacter.name}"
val inactiveName = "inactive_${request.name}"
val randomSuffix = "_" + java.util.UUID.randomUUID().toString().replace("-", "")
chatCharacter.name = inactiveName + randomSuffix
return saveChatCharacter(chatCharacter)
}