mirror of
https://github.com/homarr-labs/dashboard-icons.git
synced 2026-01-12 16:25:38 +08:00
refactor(community): rename and export fetchCommunitySubmissions function for improved data fetching
This commit is contained in:
@@ -2,7 +2,9 @@ import type { Metadata } from "next"
|
||||
import { Suspense } from "react"
|
||||
import { CommunityIconSearch } from "@/components/community-icon-search"
|
||||
import { BASE_URL } from "@/constants"
|
||||
import { getCommunitySubmissions } from "@/lib/community"
|
||||
import { fetchCommunitySubmissions, getCommunitySubmissions } from "@/lib/community"
|
||||
|
||||
export const revalidate = 300
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const icons = await getCommunitySubmissions()
|
||||
@@ -39,7 +41,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
}
|
||||
|
||||
export default async function CommunityPage() {
|
||||
const icons = await getCommunitySubmissions()
|
||||
const icons = await fetchCommunitySubmissions();
|
||||
return (
|
||||
<div className="isolate overflow-hidden p-2 mx-auto max-w-7xl">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
|
||||
|
||||
@@ -118,7 +118,7 @@ function transformGalleryToIcon(item: CommunityGallery): any {
|
||||
* Uses the community_gallery view collection for public-facing data
|
||||
* This is the raw fetch function without caching
|
||||
*/
|
||||
async function fetchCommunitySubmissions(): Promise<IconWithName[]> {
|
||||
export async function fetchCommunitySubmissions(): Promise<IconWithName[]> {
|
||||
try {
|
||||
const pb = createServerPB()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user