diff --git a/platform/frontend/topics.html b/platform/frontend/topics.html index 5ae4394..abccae7 100644 --- a/platform/frontend/topics.html +++ b/platform/frontend/topics.html @@ -143,7 +143,7 @@ -
+
{{ topic.title }}
@@ -185,12 +185,20 @@ const TopicsApp = { data() { return { isLoggedIn: false, isAdmin: false, currentUser: { username: '' }, topics: [], filterStatus: '', selectedTopicIds: [], loadingTable: false } }, computed: { - filteredTopics() { if (!this.topics.length) return []; if (!this.filterStatus) return this.topics; return this.topics.filter(t => t.status === this.filterStatus); }, + filteredTopics() { + console.log('[DEBUG] filteredTopics called, filterStatus:', this.filterStatus, 'topics count:', this.topics.length); + if (!this.topics.length) { console.log('[DEBUG] topics is empty'); return []; } + if (!this.filterStatus) { console.log('[DEBUG] no filter, return all'); return this.topics; } + const result = this.topics.filter(t => t.status === this.filterStatus); + console.log('[DEBUG] filtered result count:', result.length); + return result; + }, countByStatus() { return (status) => this.topics.filter(t => t.status === status).length; } }, methods: { async fetchTopics() { this.loadingTable = true; + console.log('[DEBUG] fetchTopics called'); try { const token = localStorage.getItem('authToken'); const response = await fetch('/api/topics', { headers: { 'Authorization': 'Bearer ' + token } });