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