Skip to content

Commit 0f46d31

Browse files
committed
Fixed type issues
1 parent 2197cf2 commit 0f46d31

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app/api/add-forum-post/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function POST(request: NextRequest) {
8383
topicData.accepted_answer.post_number
8484
) {
8585
const acceptedPost = posts.find(
86-
post =>
86+
(post: { post_number: number }) =>
8787
post.post_number ===
8888
topicData.accepted_answer.post_number
8989
);
@@ -95,7 +95,7 @@ export async function POST(request: NextRequest) {
9595
// If still no solution, try the post.accepted_answer property
9696
if (!solutionHtml) {
9797
const acceptedAnswerPost = posts.find(
98-
post => post.accepted_answer === true
98+
(post: { accepted_answer: boolean }) => post.accepted_answer === true
9999
);
100100

101101
if (acceptedAnswerPost) {
@@ -154,7 +154,7 @@ export async function POST(request: NextRequest) {
154154

155155
// Check if the topic already exists (by URL)
156156
const existingIndex = existingData.findIndex(
157-
item => item.url === newEntry.url
157+
(item: { url: string }) => item.url === newEntry.url
158158
);
159159

160160
if (existingIndex !== -1) {

src/app/community-forum/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default function AddForumPost() {
2525
setStatus({ type: 'loading', message: 'Processing forum post...' })
2626

2727
try {
28-
const response = await fetch('/docs/api/add-forum-post', {
28+
const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : ''
29+
const response = await fetch(`${basePath}/api/add-forum-post`, {
2930
method: 'POST',
3031
headers: {
3132
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)