Skip to content

Commit a7c2fbc

Browse files
committed
Revert "remove useQueryState to fix build issue"
This reverts commit 3b9dc0c.
1 parent 3b9dc0c commit a7c2fbc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/[locale]/manage/usecases/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
'use client';
22

3+
import { useEffect } from 'react';
4+
import { useRouter } from 'next/navigation';
35
import { graphql } from '@/gql';
46
import { useMutation, useQuery } from '@tanstack/react-query';
5-
import { useRouter } from 'next/navigation';
7+
import { parseAsString, useQueryState } from 'next-usequerystate';
68
import { Button, DataTable, Icon, IconButton, Text, toast } from 'opub-ui';
7-
import { useEffect, useState } from 'react';
89
import { twMerge } from 'tailwind-merge';
910

10-
import { LinkButton } from '@/components/Link';
11+
import { GraphQL } from '@/lib/api';
1112
import { Icons } from '@/components/icons';
13+
import { LinkButton } from '@/components/Link';
1214
import { Loading } from '@/components/loading';
13-
import { GraphQL } from '@/lib/api';
1415
import { ActionBar } from '../../dashboard/[entityType]/[entitySlug]/dataset/components/action-bar';
1516
import { Navigation } from '../../dashboard/[entityType]/[entitySlug]/dataset/components/navigate-org-datasets';
1617

@@ -50,7 +51,7 @@ export default function DatasetPage({
5051
}) {
5152
const router = useRouter();
5253

53-
const [navigationTab, setNavigationTab] = useState('tab');
54+
const [navigationTab, setNavigationTab] = useQueryState('tab', parseAsString);
5455

5556
let navigationOptions = [
5657
{
@@ -96,8 +97,7 @@ export default function DatasetPage({
9697
error: any;
9798
} = useMutation(
9899
[`delete_Usecase`],
99-
(data: { id: string }) =>
100-
GraphQL(deleteUseCase, {}, { useCaseId: data.id }),
100+
(data: { id: string }) => GraphQL(deleteUseCase,{}, { useCaseId: data.id }),
101101
{
102102
onSuccess: () => {
103103
toast(`Deleted UseCase successfully`);
@@ -113,7 +113,7 @@ export default function DatasetPage({
113113
mutate: any;
114114
isLoading: boolean;
115115
error: any;
116-
} = useMutation([`delete_Usecase`], () => GraphQL(AddUseCase, {}, []), {
116+
} = useMutation([`delete_Usecase`], () => GraphQL(AddUseCase,{}, []), {
117117
onSuccess: (response: any) => {
118118
toast(`UseCase created successfully`);
119119
router.push(`/manage/usecases/edit/${response.addUseCase.id}/details`);

0 commit comments

Comments
 (0)