File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
apps/question-service/src Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ import {
34
34
CategoriesOption ,
35
35
DifficultyOption ,
36
36
OrderOption ,
37
- } from "./utils/SelectOptions" ;
37
+ } from "../utils/SelectOptions" ;
38
+ import Link from "next/link" ;
38
39
39
40
/**
40
41
* defines the State of the page whe a user is deleing an object. Has 3 general states:
@@ -167,7 +168,16 @@ export default function Home() {
167
168
title : "Title" ,
168
169
dataIndex : "title" ,
169
170
key : "title" ,
170
- render : ( text : string ) => < Button type = "link" > { text } </ Button > , // TODO (Sean): Onclick links to the individual question page
171
+ render : ( text : string , question : Question ) => (
172
+ < Link
173
+ href = { {
174
+ pathname : `/question/${ question . id } ` ,
175
+ query : { data : question . docRefId } , // the data
176
+ } }
177
+ >
178
+ < Button type = "link" > { text } </ Button >
179
+ </ Link >
180
+ ) , // TODO (Sean): Onclick links to the individual question page
171
181
} ,
172
182
{
173
183
title : "Categories" ,
Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { useSearchParams } from "next/navigation" ;
4
+
5
+ const QuestionPage = ( ) : JSX . Element => {
6
+ const searchParams = useSearchParams ( ) ;
7
+ const docRefId = searchParams . get ( "data" ) ;
8
+
9
+ // TODO: use docRefId to fetch the data via the service function and display the data below
10
+ return < div > Hello World! { docRefId } </ div > ;
11
+ } ;
12
+
13
+ export default QuestionPage ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments