fix(admin): resolve GET/PUT /admin/settings 404, videos.map crash, and remove legacy CMS sidebar link
Deploy Canina / deploy (push) Failing after 29s

This commit is contained in:
parsa aghaei committed 2026-08-08 18:26:05 +03:30
1 parent df340143dc
commit 43cf55a8ef
3 files changed
+28 -2

No files matched your search

@@ -41,7 +41,6 @@ const menuGroups = [
{ icon: FileText, label: 'وبلاگ', path: '/blogs' },
{ icon: BookOpen, label: 'دانشنامه عمومی', path: '/wiki' },
{ icon: Video, label: 'مدیریت ویدئوها', path: '/videos' },
{ icon: Image, label: 'مدیریت CMS قدیم', path: '/cms' },
]
},
{
+14 -1
View File
@@ -45,9 +45,22 @@ export default function Videos() {
api.get('/videos', {
params: { search: searchTerm, limit: 100 },
}).then(res => {
if (isSubscribed) setVideos(res.data.data || res.data || []);
if (isSubscribed) {
const raw = res.data;
const videoList = Array.isArray(raw?.videos)
? raw.videos
: Array.isArray(raw?.data?.videos)
? raw.data.videos
: Array.isArray(raw?.data)
? raw.data
: Array.isArray(raw)
? raw
: [];
setVideos(videoList);
}
}).catch(err => {
console.error('Failed to fetch videos:', err);
if (isSubscribed) setVideos([]);
}).finally(() => {
if (isSubscribed) setIsLoading(false);
});