feat: initialize Prisma schema and scaffold core application modules including auth, blogs, events, and business directories
Some checks failed
Build and Push App / build (push) Failing after 47s
Some checks failed
Build and Push App / build (push) Failing after 47s
This commit is contained in:
@@ -34,13 +34,12 @@ const AnnuairePageContent = () => {
|
||||
useEffect(() => {
|
||||
const fetchHeadliner = async () => {
|
||||
try {
|
||||
const res = await fetch('/api/businesses?featured=true');
|
||||
// Disable caching to ensure we get fresh data and more variety
|
||||
const res = await fetch('/api/businesses?featured=true', { cache: 'no-store' });
|
||||
const data = await res.json();
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
// Stable random based on the current date (YYYYMMDD)
|
||||
const today = new Date().toISOString().slice(0, 10).replace(/-/g, '');
|
||||
const seed = parseInt(today);
|
||||
const randomIndex = seed % data.length;
|
||||
// Truly random selection from the pool of featured businesses
|
||||
const randomIndex = Math.floor(Math.random() * data.length);
|
||||
setFeaturedBusiness(data[randomIndex]);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user