refactor: Update API response handling to access nested data structure

This commit is contained in:
Yusuf İpek
2026-02-07 17:59:37 +03:00
parent 49c3ac61ea
commit f6044f3c24
14 changed files with 45 additions and 37 deletions
+3 -2
View File
@@ -222,7 +222,8 @@ export default function WatchPage() {
try {
const res = await fetch(`/api/projects/${projectId}/tags`);
if (res.ok) {
const tags = await res.json();
const data = await res.json();
const tags = data.data || [];
setAvailableTags(tags);
// Auto-select first tag (Feedback) as default
if (tags.length > 0 && !selectedTagId) {
@@ -1118,7 +1119,7 @@ export default function WatchPage() {
const res = await fetch(`/api/watch/${videoId}`);
if (res.ok) {
const data = await res.json();
setVideo(data);
setVideo(data.data);
}
} catch { /* silent */ }
}, 10000);