fix(admin): enhance media manager with all file types and progress, fix videos sync and home display
Deploy Canina / deploy (push) Successful in 1m49s
Deploy Canina / deploy (push) Successful in 1m49s
This commit is contained in:
1 parent
2d83a00169
commit
bea0488efb
6 files changed
+571
-356
No files matched your search
@@ -16,7 +16,12 @@ export const videoService = {
|
||||
getVideos: async (params?: { featured?: boolean; limit?: number; search?: string }) => {
|
||||
try {
|
||||
const res = await api.get('/videos', { params });
|
||||
return res.data.data || res.data || [];
|
||||
const raw = res.data;
|
||||
if (Array.isArray(raw?.videos)) return raw.videos;
|
||||
if (Array.isArray(raw?.data?.videos)) return raw.data.videos;
|
||||
if (Array.isArray(raw?.data)) return raw.data;
|
||||
if (Array.isArray(raw)) return raw;
|
||||
return [];
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch videos from API:', error);
|
||||
return [];
|
||||
|
||||
Reference in new issue
Block a user