feat(chat): 캐릭터 리스트, 추가/수정 폼, 배너

- response의 데이터 구조에 맞춰서 코드 수정
This commit is contained in:
Yu Sung
2025-08-12 21:09:08 +09:00
parent a3e82a81f8
commit ba248f7680
4 changed files with 119 additions and 61 deletions

View File

@@ -380,14 +380,18 @@ export default {
try {
const response = await getCharacterList(this.page);
if (response && response.data) {
const data = response.data;
this.characters = data.content || [];
if (response && response.status === 200) {
if (response.data.success === true) {
const data = response.data.data;
this.characters = data.content || [];
const total_page = Math.ceil((data.totalCount || 0) / 20);
this.total_page = total_page <= 0 ? 1 : total_page;
const total_page = Math.ceil((data.totalCount || 0) / 20);
this.total_page = total_page <= 0 ? 1 : total_page;
} else {
this.notifyError('응답 데이터가 없습니다.');
}
} else {
this.notifyError('응답 데이터가 없습니다.');
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.');
}
} catch (e) {
console.error('캐릭터 목록 조회 오류:', e);
@@ -412,8 +416,8 @@ export default {
try {
const response = await searchCharacters(this.search_word, this.page);
if (response && response.data) {
const data = response.data;
if (response && response.status === 200 && response.data && response.data.success === true) {
const data = response.data.data;
this.characters = data.content || [];
const total_page = Math.ceil((data.totalCount || 0) / 20);