fix(banners): save relative storage paths so admin preview survives refresh
Uploads were stored as host-specific URLs and a force-reload could wipe a just-saved image, leaving a broken dark-theme preview. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -90,11 +90,11 @@ function parseSlider(raw: unknown): IBenefits[] {
|
||||
return []
|
||||
}
|
||||
|
||||
export function parseAppBanners(value: string | null | undefined): AppBannersValue {
|
||||
export function parseAppBanners(value: string | Record<string, unknown> | null | undefined): AppBannersValue {
|
||||
const fallback = emptyAppBanners()
|
||||
if (!value) return fallback
|
||||
try {
|
||||
const parsed = JSON.parse(value)
|
||||
const parsed = typeof value === 'string' ? JSON.parse(value) : value
|
||||
if (!parsed || typeof parsed !== 'object') return fallback
|
||||
|
||||
// فرمت قدیمی: فقط آرایهٔ اسلایدر (header_banner)
|
||||
|
||||
Reference in New Issue
Block a user