File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
app/[locale]/dashboard/[entityType]/[entitySlug]/charts/components Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 11import { UUID } from 'crypto' ;
22import React , { useEffect , useState } from 'react' ;
33import Link from 'next/link' ;
4- import { useParams } from 'next/navigation' ;
4+ import { useParams , useRouter } from 'next/navigation' ;
55import { graphql } from '@/gql' ;
66import { useMutation , useQuery } from '@tanstack/react-query' ;
77import {
@@ -113,6 +113,8 @@ const ChartsList: React.FC<ChartsListProps> = ({
113113 id : string ;
114114 } > ( ) ;
115115
116+ const router = useRouter ( ) ;
117+
116118 const [ editorView , setEditorView ] = useState ( false ) ;
117119
118120 const chartListRes : {
@@ -250,11 +252,13 @@ const ChartsList: React.FC<ChartsListProps> = ({
250252
251253 const handleChart = ( row : any ) => {
252254 if ( row . original . typename === 'TypeResourceChart' ) {
253- setType ( 'visualize' ) ;
254- setChartId ( row . original . id ) ;
255+ router . push (
256+ `/dashboard/${ params . entityType } /${ params . entitySlug } /charts/${ row . original . id } ?type=TypeResourceChart`
257+ ) ;
255258 } else {
256- setType ( 'img' ) ;
257- setImageId ( row . original . id ) ;
259+ router . push (
260+ `/dashboard/${ params . entityType } /${ params . entitySlug } /charts/${ row . original . id } ?type=TypeResourceChartImage`
261+ ) ;
258262 }
259263 } ;
260264
You can’t perform that action at this time.
0 commit comments