File tree Expand file tree Collapse file tree 4 files changed +20
-18
lines changed
Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -48,29 +48,23 @@ export const fetchIdeas = async ({
4848 limit,
4949 cursorId,
5050 name,
51- track ,
51+
5252} : {
5353 limit : number ;
5454 cursorId ?: string ;
5555 name ?: string ;
56- track ?: number ;
5756} ) => {
5857 try {
5958 const params = new URLSearchParams ( { limit : String ( limit ) } ) ;
6059
6160
6261 if ( name ) {
63- params . append ( "title " , name ) ;
62+ params . append ( "search " , name ) ;
6463 } else if ( cursorId ) {
6564 params . append ( "cursor" , cursorId ) ;
6665 }
67- else if ( track ) {
68- params . append ( "track" , String ( track ) )
69- }
70- const url =
71- ( track || name )
72- ? `admin/ideas/filter?${ params . toString ( ) } `
73- : `admin/ideas?${ params . toString ( ) } ` ;
66+
67+ const url = `admin/ideas?${ params . toString ( ) } ` ;
7468
7569 const response = await axios . get < ideaResponseType > ( url ) ;
7670 const parsedResponse = ideasResponseSchema . parse ( response . data ) ;
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ export default function TeamsIdeasTable() {
4949 fetchIdeas ( {
5050 limit : pageLimit ,
5151 cursorId : currentCursor ,
52- track : Number ( selectedTrack ) ,
5352 name : nameDebounce
5453 } ) ,
5554 } ) ;
@@ -158,10 +157,10 @@ export default function TeamsIdeasTable() {
158157 value = { searchTerm }
159158 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
160159 />
161- < Select
160+ { /* <Select
162161 value={selectedTrack ?? ""}
163162 onValueChange={(value) => {
164- setSelectedTrack ( value === "all" ? "" : String ( Number ( value ) ) ) ;
163+ setSearchTerm (value === "all" ? "" : String(Number(value)));
165164 }}
166165 >
167166 <SelectTrigger className="w-48 p-6">
@@ -175,7 +174,7 @@ export default function TeamsIdeasTable() {
175174 </SelectItem>
176175 ))}
177176 </SelectContent>
178- </ Select >
177+ </Select> */ }
179178 </ div >
180179 {
181180 < DataTable
Original file line number Diff line number Diff line change @@ -7,24 +7,33 @@ import { type z } from "zod";
77import ViewScores from "../ViewScores" ;
88import ChangeRound from "../changeRound" ;
99import { Button } from "../ui/button" ;
10+ import { DataTableColumnHeader } from "../table/data-table-column-header" ;
1011
1112const columns : ColumnDef < z . infer < typeof leaderboardUserSchema > > [ ] = [
1213 {
1314 accessorKey : "team_name" ,
14- header : "Team Name" ,
15+ header : ( { column} ) => (
16+ < DataTableColumnHeader column = { column } title = "Team Name" />
17+ )
1518 } ,
1619 {
1720 accessorKey : "overall_total" ,
18- header : "Final Score" ,
21+ header : ( { column} ) => (
22+ < DataTableColumnHeader column = { column } title = "Final Score" />
23+ )
1924 } ,
2025 {
2126 accessorKey : "rounds" ,
22- header : "Scores" ,
27+ header : ( { column} ) => (
28+ < DataTableColumnHeader column = { column } title = "Scores" />
29+ ) ,
2330 cell : ( { row } ) => < ViewScores row = { row } /> ,
2431 } ,
2532 {
2633 accessorKey : "ID" ,
27- header : "Change Round" ,
34+ header : ( { column} ) => (
35+ < DataTableColumnHeader column = { column } title = "Change Round" />
36+ ) ,
2837 cell : ( { row } ) => < ChangeRound id = { row . original . team_id } prefill = { String ( row . original . rounds . length ) } /> ,
2938 } ,
3039 {
You can’t perform that action at this time.
0 commit comments