릴리스: v1.4.21 프런트 topic 응답 소비 정리

This commit is contained in:
2026-04-02 20:25:49 +09:00
parent 28fa7bb37d
commit 337bee8900
11 changed files with 31 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ const templates = computed(() => {
async function loadTemplates() {
try {
const data = await api.listTopics()
templateRecords.value = data.games || []
templateRecords.value = data.topics || data.games || []
} catch (e) {
error.value = '백엔드에 연결할 수 없어요. backend 서버가 실행 중인지 확인해주세요.'
}
@@ -61,7 +61,7 @@ async function toggleFavorite(template, event) {
try {
loadingFavoriteId.value = template.id
const res = template.isFavorited ? await api.unfavoriteTopic(template.id) : await api.favoriteTopic(template.id)
templateRecords.value = templateRecords.value.map((entry) => (entry.id === template.id ? { ...entry, ...res.game } : entry))
templateRecords.value = templateRecords.value.map((entry) => (entry.id === template.id ? { ...entry, ...(res.topic || res.game || {}) } : entry))
} catch (e) {
error.value = '즐겨찾기 변경에 실패했어요.'
} finally {