fix(ui): properly parse boolean setting and enforce dynamic server rendering for NewsCard feed
This commit is contained in:
parent
926c704fdd
commit
d61729b92e
@ -23,7 +23,7 @@ async function fetchClasificadosData() {
|
||||
const postsCount = settings.feed_news_count || 12;
|
||||
const cardSettings = {
|
||||
showCategory: settings.news_card_show_category ?? false,
|
||||
showFooterDate: String(settings.show_news_date) === 'true',
|
||||
showFooterDate: settings.show_news_date !== false,
|
||||
showFooterButton: settings.news_card_show_footer_button ?? true,
|
||||
footerText: settings.news_card_footer_text || ""
|
||||
};
|
||||
|
||||
@ -124,7 +124,7 @@ export default async function SettingsPage() {
|
||||
type="checkbox"
|
||||
name="show_news_date"
|
||||
value="true"
|
||||
defaultChecked={settings.show_news_date === true}
|
||||
defaultChecked={settings.show_news_date !== false}
|
||||
id="show_news_date"
|
||||
className="w-5 h-5 accent-cyan-500 cursor-pointer"
|
||||
/>
|
||||
|
||||
@ -23,7 +23,7 @@ async function fetchEventosData() {
|
||||
const postsCount = settings.feed_news_count || 12;
|
||||
const cardSettings = {
|
||||
showCategory: settings.news_card_show_category ?? false,
|
||||
showFooterDate: String(settings.show_news_date) === 'true',
|
||||
showFooterDate: settings.show_news_date !== false,
|
||||
showFooterButton: settings.news_card_show_footer_button ?? true,
|
||||
footerText: settings.news_card_footer_text || ""
|
||||
};
|
||||
|
||||
@ -25,7 +25,7 @@ async function fetchHomeData() {
|
||||
const postsCount = settings.feed_news_count || 12;
|
||||
const cardSettings = {
|
||||
showCategory: settings.news_card_show_category ?? false,
|
||||
showFooterDate: String(settings.show_news_date) === 'true',
|
||||
showFooterDate: settings.show_news_date !== false,
|
||||
showFooterButton: settings.news_card_show_footer_button ?? true,
|
||||
footerText: settings.news_card_footer_text || ""
|
||||
};
|
||||
@ -69,6 +69,8 @@ async function fetchHomeData() {
|
||||
}
|
||||
}
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Home() {
|
||||
const { posts, cardSettings } = await fetchHomeData();
|
||||
const hasSidebar = await hasSidebarContent();
|
||||
|
||||
7
test-settings.js
Normal file
7
test-settings.js
Normal file
@ -0,0 +1,7 @@
|
||||
const { Client, Databases } = require('node-appwrite');
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://appwrite.almeira.com.co/v1')
|
||||
.setProject('69b84df5003bd8957c5c')
|
||||
.setKey(process.env.APPWRITE_API_KEY || ''); // I don't have api key injected here securely ? Wait, I can execute node with the .env variables.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user