fix: remove fallback content, fix video upload and positioning

- Remove hardcoded fallback data — DB is sole content source
- Sections render conditionally when data exists
- Hero video slots save after each upload (not only when all 3 filled)
- Video positions preserved (left/center/right) with empty string slots
- Client-side 10MB hard limit on video uploads with clear error
- Server-side upload error handling for body size limits
- Guard Team section against empty members array
- Clean up old uploaded images and videos
This commit is contained in:
2026-03-29 22:17:11 +03:00
parent 77ad2a6b68
commit e56a6a1608
66 changed files with 75 additions and 66 deletions
+3 -4
View File
@@ -1,11 +1,10 @@
import { getSiteContent } from "@/lib/db";
import { siteContent as fallback } from "@/data/content";
import type { SiteContent } from "@/types/content";
let cached: { data: SiteContent; expiresAt: number } | null = null;
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
export function getContent(): SiteContent {
export function getContent(): SiteContent | null {
const now = Date.now();
if (cached && now < cached.expiresAt) {
return cached.data;
@@ -17,9 +16,9 @@ export function getContent(): SiteContent {
cached = { data: content, expiresAt: now + CACHE_TTL };
return content;
}
return fallback;
return null;
} catch {
return fallback;
return null;
}
}