feat(character): 캐릭터 로드, 저장, 수정

- success가 true여야만 다음 행동을 하도록 처리
This commit is contained in:
Yu Sung 2025-08-07 21:37:09 +09:00
parent 062bb4f7b2
commit bbacab88c5
1 changed files with 9 additions and 8 deletions

View File

@ -922,19 +922,21 @@ export default {
image: null, image: null,
imageUrl: '', imageUrl: '',
isActive: true, isActive: true,
createdAt: '',
gender: '', gender: '',
age: '', age: '',
mbti: '', mbti: '',
worldView: '',
relationships: '',
personality: '',
speechPattern: '', speechPattern: '',
conversationStyle: '', conversationStyle: '',
appearance: '', appearance: '',
systemPrompt: '', systemPrompt: '',
tags: [], tags: [],
memories: [] memories: [],
relationships: [],
hobbies: [],
values: [],
goals: [],
personalities: [],
backgrounds: []
}, },
ageRules: [ ageRules: [
v => !!v || '나이를 입력하세요', v => !!v || '나이를 입력하세요',
@ -1331,7 +1333,7 @@ export default {
const response = await getCharacter(id); const response = await getCharacter(id);
// API // API
if (response && response.data) { if (response && response.success === true && response.data) {
const data = response.data; const data = response.data;
// ( ) // ( )
@ -1390,7 +1392,6 @@ export default {
if (this.isEdit) { if (this.isEdit) {
// //
const changedData = this.getChangedFields(); const changedData = this.getChangedFields();
console.log('변경된 필드만 전송:', changedData);
response = await updateCharacter(changedData, this.character.image); response = await updateCharacter(changedData, this.character.image);
} else { } else {
// ID // ID
@ -1399,7 +1400,7 @@ export default {
response = await createCharacter(characterWithoutId); response = await createCharacter(characterWithoutId);
} }
if (response && response.data) { if (response && response.success === true && response.data) {
this.notifySuccess(this.isEdit ? '캐릭터가 수정되었습니다.' : '캐릭터가 등록되었습니다.'); this.notifySuccess(this.isEdit ? '캐릭터가 수정되었습니다.' : '캐릭터가 등록되었습니다.');
this.goBack(); this.goBack();
} else { } else {