MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getForData

Function getForData

apps/public/src/lib/for.ts:89–102  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

87const contentDir = join(process.cwd(), 'content', 'for');
88
89export async function getForData(slug: string): Promise<ForData | null> {
90 try {
91 const filePath = join(contentDir, `${slug}.json`);
92 const fileContents = readFileSync(filePath, 'utf8');
93 const data = JSON.parse(fileContents) as ForData;
94 return {
95 ...data,
96 url: `/for/${slug}`,
97 };
98 } catch (error) {
99 console.error(`Error loading for data for ${slug}:`, error);
100 return null;
101 }
102}
103
104export async function getAllForSlugs(): Promise<string[]> {
105 try {

Callers 4

FooterFunction · 0.90
ForListPageFunction · 0.90
generateMetadataFunction · 0.90
ForPageFunction · 0.90

Calls 3

joinFunction · 0.85
parseMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected