Skip to content

Commit 41afb4d

Browse files
committed
chore: fix build
1 parent 1c1ee07 commit 41afb4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/api/index-to-algolia/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import crypto from 'crypto';
88
import { getAllPosts } from '@/lib/api-docs';
99
import Route from '@/lib/route';
1010

11+
const DOCS_DIR_PATH = `${process.cwd()}/content/docs`;
12+
1113
const algoliaClient = algoliasearch(
1214
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID!,
1315
process.env.NEXT_PUBLIC_ALGOLIA_ADMIN_API_KEY!,
@@ -80,7 +82,7 @@ const generateIndexElement = (
8082
};
8183

8284
const getRecords = () => {
83-
const docs = getAllPosts().filter((item) => !item.slug.startsWith('tutorials/'));
85+
const docs = getAllPosts(DOCS_DIR_PATH).filter((item) => !item.slug.startsWith('tutorials/'));
8486

8587
const resultObj: AlgoliaIndexObject[] = [];
8688

0 commit comments

Comments
 (0)