feat(chat): 캐릭터 리스트, 추가/수정 폼, 배너
- response의 데이터 구조에 맞춰서 코드 수정
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user