File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export const ideasResponseSchema = z.object({
3535 status : z . string ( ) , // Ensures the status is always "success"
3636 message : z . string ( ) ,
3737 data : z . array ( ideaSchema ) ,
38+ next_cursor : z . string ( ) . nullable ( ) ,
3839} ) ;
3940export type ideaType = z . infer < typeof ideaSchema > ;
4041
@@ -49,7 +50,7 @@ export const fetchIdeas = async ({
4950 limit : number ;
5051 cursorId ?: string ;
5152 name ?: string ;
52- track ?: number ;
53+ track ?: string ;
5354} ) => {
5455 try {
5556 const params = new URLSearchParams ( { limit : String ( limit ) } ) ;
@@ -59,14 +60,14 @@ export const fetchIdeas = async ({
5960 } else if ( cursorId ) {
6061 params . append ( "cursor" , cursorId ) ;
6162 }
62- const url = track !== undefined ? `admin/ideas/${ track } / ?${ params . toString ( ) } ` : `admin/ideas?${ params . toString ( ) } ` ;
63+ const url = track !== "" ? `admin/ideas/${ track } ?${ params . toString ( ) } ` : `admin/ideas?${ params . toString ( ) } ` ;
6364
6465 const response = await axios . get < ideaResponseType > ( url ) ;
6566 const parsedResponse = ideasResponseSchema . parse ( response . data ) ;
6667 console . log ( parsedResponse . data ) ;
6768
6869 //send in next cursor when data is done
69- const nextCursor = "1" ;
70+ const nextCursor = parsedResponse . next_cursor ;
7071
7172 return {
7273 idea : parsedResponse . data ,
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export default function TeamsIdeasTable() {
4848 fetchIdeas ( {
4949 limit : pageLimit ,
5050 cursorId : undefined ,
51+ track : selectedTrack ,
5152 } ) ,
5253 } ) ;
5354 const handleNextPage = ( ) => {
@@ -69,7 +70,7 @@ export default function TeamsIdeasTable() {
6970 {
7071 accessorKey : "numberOfPeople" ,
7172 header : ( { column } ) => (
72- < DataTableColumnHeader column = { column } title = "Team Size " />
73+ < DataTableColumnHeader column = { column } title = "Team ID " />
7374 ) ,
7475 cell : ( { row } ) => (
7576 < div className = "text-center" > { row . original . TeamID } </ div >
You can’t perform that action at this time.
0 commit comments