File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,9 @@ export default function ProblemsPage({
116116 onDelete = { handleDelete }
117117 allowDownload = { true }
118118 addPage = "new"
119- editPathAttr = "id "
119+ editPathAttr = "nameId "
120120 rowClickAttr = "nameId"
121+ editPathSuffix = "edit"
121122 />
122123 { /*
123124 <Dialog open={isEditorOpen} onOpenChange={setIsEditorOpen}>
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ interface GenericListingProps<T> {
4949 addPage ?: string ;
5050 rowClickAttr ?: keyof T ; // attribute to use for navigation when row is clicked
5151 editPathAttr ?: keyof T ; // attribute containing the edit path for navigation
52+ editPathSuffix ?: string ;
5253}
5354
5455// For passing to listing, the id should not be null, its just a temporary hack to satisfy typescript
@@ -64,6 +65,7 @@ export function GenericListing<T extends { id: number | undefined }>({
6465 addPage,
6566 rowClickAttr,
6667 editPathAttr,
68+ editPathSuffix,
6769} : GenericListingProps < T > ) {
6870 const router = useRouter ( ) ;
6971 const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
@@ -270,7 +272,7 @@ export function GenericListing<T extends { id: number | undefined }>({
270272 onEdit ( item ) ;
271273 } else if ( editPathAttr && item [ editPathAttr ] ) {
272274 router . push (
273- `${ window . location . pathname } /${ String ( item [ editPathAttr ] ) } ` ,
275+ `${ window . location . pathname } /${ String ( item [ editPathAttr ] ) } / ${ editPathSuffix } ` ,
274276 ) ;
275277 }
276278 } }
You can’t perform that action at this time.
0 commit comments