File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff 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 )  { 
Original file line number Diff line number Diff 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' , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments