Fix: Finalize settings for NewsCard footer button and fix Ticker images

This commit is contained in:
Carlos (Almeira) 2026-03-26 14:50:41 -05:00
parent a31532cb03
commit 48ad517133
3 changed files with 9 additions and 3 deletions

View File

@ -10,12 +10,13 @@ async function fetchClasificadosData() {
// 1. Settings // 1. Settings
const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []); const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []);
const settings = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {}; const settings: any = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {};
const postsCount = settings.classifieds_count || 9; const postsCount = settings.classifieds_count || 9;
const cardSettings = { const cardSettings = {
showCategory: settings.news_card_show_category ?? false, showCategory: settings.news_card_show_category ?? false,
showFooterDate: settings.news_card_show_footer_date ?? true, showFooterDate: settings.news_card_show_footer_date ?? true,
showFooterButton: settings.news_card_show_footer_button ?? true,
footerText: settings.news_card_footer_text || "" footerText: settings.news_card_footer_text || ""
}; };
@ -125,6 +126,7 @@ export default async function ClasificadosPage() {
imagenUrl={imagenUrl} imagenUrl={imagenUrl}
showCategory={cardSettings.showCategory} showCategory={cardSettings.showCategory}
showFooterDate={cardSettings.showFooterDate} showFooterDate={cardSettings.showFooterDate}
showFooterButton={cardSettings.showFooterButton}
footerText={cardSettings.footerText} footerText={cardSettings.footerText}
/> />
) )

View File

@ -10,12 +10,13 @@ async function fetchEventosData() {
// 1. Settings // 1. Settings
const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []); const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []);
const settings = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {}; const settings: any = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {};
const postsCount = settings.events_count || 9; const postsCount = settings.events_count || 9;
const cardSettings = { const cardSettings = {
showCategory: settings.news_card_show_category ?? false, showCategory: settings.news_card_show_category ?? false,
showFooterDate: settings.news_card_show_footer_date ?? true, showFooterDate: settings.news_card_show_footer_date ?? true,
showFooterButton: settings.news_card_show_footer_button ?? true,
footerText: settings.news_card_footer_text || "" footerText: settings.news_card_footer_text || ""
}; };
@ -125,6 +126,7 @@ export default async function EventosPage() {
imagenUrl={imagenUrl} imagenUrl={imagenUrl}
showCategory={cardSettings.showCategory} showCategory={cardSettings.showCategory}
showFooterDate={cardSettings.showFooterDate} showFooterDate={cardSettings.showFooterDate}
showFooterButton={cardSettings.showFooterButton}
footerText={cardSettings.footerText} footerText={cardSettings.footerText}
/> />
) )

View File

@ -11,12 +11,13 @@ async function fetchHomeData() {
// 1. Settings // 1. Settings
const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []); const settingsRes = await client.databases.listDocuments(APPWRITE_ALMEIRA_CONFIG.databaseId, 'settings', []);
const settings = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {}; const settings: any = settingsRes.documents.length > 0 ? settingsRes.documents[0] : {};
const postsCount = settings.feed_count || settings.post_count || 9; const postsCount = settings.feed_count || settings.post_count || 9;
const cardSettings = { const cardSettings = {
showCategory: settings.news_card_show_category ?? false, showCategory: settings.news_card_show_category ?? false,
showFooterDate: settings.news_card_show_footer_date ?? true, showFooterDate: settings.news_card_show_footer_date ?? true,
showFooterButton: settings.news_card_show_footer_button ?? true,
footerText: settings.news_card_footer_text || "" footerText: settings.news_card_footer_text || ""
}; };
@ -148,6 +149,7 @@ export default async function Home() {
imagenUrl={imagenUrl} imagenUrl={imagenUrl}
showCategory={cardSettings.showCategory} showCategory={cardSettings.showCategory}
showFooterDate={cardSettings.showFooterDate} showFooterDate={cardSettings.showFooterDate}
showFooterButton={cardSettings.showFooterButton}
footerText={cardSettings.footerText} footerText={cardSettings.footerText}
/> />
) )