Skip to content

Commit cfc8ebf

Browse files
committed
add extra curly bracket in graphql fxn
1 parent cf63ac0 commit cfc8ebf

File tree

4 files changed

+49
-33
lines changed

4 files changed

+49
-33
lines changed

app/[locale]/manage/usecases/edit/[id]/assign/page.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ const Assign = () => {
5252
useQuery(
5353
[`UseCase_Details`],
5454
() =>
55-
GraphQL(FetchUseCaseDetails, {
56-
filters: {
57-
id: params.id,
58-
},
59-
}),
55+
GraphQL(
56+
FetchUseCaseDetails,
57+
{},
58+
{
59+
filters: {
60+
id: params.id,
61+
},
62+
}
63+
),
6064
{
6165
refetchOnMount: true,
6266
refetchOnReconnect: true,
@@ -102,16 +106,20 @@ const Assign = () => {
102106

103107
const { mutate, isLoading: mutationLoading } = useMutation(
104108
() =>
105-
GraphQL(AssignUsecaseDatasets, {
106-
useCaseId: +params.id,
107-
datasetIds: Array.isArray(selectedRow)
108-
? selectedRow.map((row: any) => row.id)
109-
: [],
110-
}),
109+
GraphQL(
110+
AssignUsecaseDatasets,
111+
{},
112+
{
113+
useCaseId: +params.id,
114+
datasetIds: Array.isArray(selectedRow)
115+
? selectedRow.map((row: any) => row.id)
116+
: [],
117+
}
118+
),
111119
{
112120
onSuccess: (data: any) => {
113121
toast('Dataset Assigned Successfully');
114-
UseCaseDetails.refetch()
122+
UseCaseDetails.refetch();
115123
router.push(`/manage/usecases/edit/${params.id}/publish`);
116124
},
117125
onError: (err: any) => {

app/[locale]/manage/usecases/edit/[id]/details/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const Details = () => {
5353
const UseCaseData: { data: any; isLoading: boolean; refetch: any } = useQuery(
5454
[`fetch_UseCaseData`],
5555
() =>
56-
GraphQL(FetchUseCase, {
56+
GraphQL(FetchUseCase,{}, {
5757
filters: {
5858
id: params.id,
5959
},
@@ -101,7 +101,7 @@ const Details = () => {
101101

102102
const { mutate, isLoading: editMutationLoading } = useMutation(
103103
(data: { data: UseCaseInputPartial }) =>
104-
GraphQL(UpdateUseCaseMutation, data),
104+
GraphQL(UpdateUseCaseMutation, {},data),
105105
{
106106
onSuccess: () => {
107107
toast('Use case updated successfully');

app/[locale]/manage/usecases/edit/[id]/publish/page.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ const Publish = () => {
6262
const UseCaseData: { data: any; isLoading: boolean; refetch: any } = useQuery(
6363
[`fetch_UsecaseDetails`],
6464
() =>
65-
GraphQL(UseCaseDetails, {
66-
filters: {
67-
id: params.id,
68-
},
69-
}),
65+
GraphQL(
66+
UseCaseDetails,
67+
{},
68+
{
69+
filters: {
70+
id: params.id,
71+
},
72+
}
73+
),
7074
{
7175
refetchOnMount: true,
7276
refetchOnReconnect: true,
@@ -75,7 +79,7 @@ const Publish = () => {
7579
const router = useRouter();
7680

7781
const { mutate, isLoading: mutationLoading } = useMutation(
78-
() => GraphQL(publishUseCaseMutation, { useCaseId: +params.id }),
82+
() => GraphQL(publishUseCaseMutation, {}, { useCaseId: +params.id }),
7983
{
8084
onSuccess: (data: any) => {
8185
toast('UseCase Published Successfully');
@@ -110,7 +114,9 @@ const Publish = () => {
110114
{ label: 'Description', value: UseCaseData.data?.useCases[0]?.description },
111115
{
112116
label: 'Logo',
113-
value: UseCaseData.data && UseCaseData.data?.useCases[0]?.logo?.name.split('/').pop(),
117+
value:
118+
UseCaseData.data &&
119+
UseCaseData.data?.useCases[0]?.logo?.name.split('/').pop(),
114120
},
115121
{
116122
label: 'Website',
@@ -122,8 +128,6 @@ const Publish = () => {
122128
},
123129
];
124130

125-
126-
127131
return (
128132
<>
129133
<div className=" w-full py-6">

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { GraphQL } from '@/lib/api';
1212
import { Icons } from '@/components/icons';
1313
import { LinkButton } from '@/components/Link';
1414
import { Loading } from '@/components/loading';
15-
import { ActionBar } from '../../dashboard/organization/[organizationId]/dataset/components/action-bar';
16-
import { Navigation } from '../../dashboard/organization/[organizationId]/dataset/components/navigate-org-datasets';
15+
import { ActionBar } from '../../dashboard/[entityType]/[entitySlug]/dataset/components/action-bar';
16+
import { Navigation } from '../../dashboard/[entityType]/[entitySlug]/dataset/components/navigate-org-datasets';
1717

1818
const allUseCases: any = graphql(`
1919
query UseCasesData($filters: UseCaseFilter, $order: UseCaseOrder) {
@@ -69,12 +69,16 @@ export default function DatasetPage({
6969
const AllUseCases: { data: any; isLoading: boolean; refetch: any } = useQuery(
7070
[`fetch_UseCases`],
7171
() =>
72-
GraphQL(allUseCases, {
73-
filters: {
74-
status: navigationTab === 'published' ? 'PUBLISHED' : 'DRAFT',
75-
},
76-
order: { modified: 'DESC' },
77-
}),
72+
GraphQL(
73+
allUseCases,
74+
{},
75+
{
76+
filters: {
77+
status: navigationTab === 'published' ? 'PUBLISHED' : 'DRAFT',
78+
},
79+
order: { modified: 'DESC' },
80+
}
81+
),
7882
{
7983
refetchOnMount: true,
8084
refetchOnReconnect: true,
@@ -93,7 +97,7 @@ export default function DatasetPage({
9397
error: any;
9498
} = useMutation(
9599
[`delete_Usecase`],
96-
(data: { id: string }) => GraphQL(deleteUseCase, { useCaseId: data.id }),
100+
(data: { id: string }) => GraphQL(deleteUseCase,{}, { useCaseId: data.id }),
97101
{
98102
onSuccess: () => {
99103
toast(`Deleted UseCase successfully`);
@@ -109,7 +113,7 @@ export default function DatasetPage({
109113
mutate: any;
110114
isLoading: boolean;
111115
error: any;
112-
} = useMutation([`delete_Usecase`], () => GraphQL(AddUseCase, []), {
116+
} = useMutation([`delete_Usecase`], () => GraphQL(AddUseCase,{}, []), {
113117
onSuccess: (response: any) => {
114118
toast(`UseCase created successfully`);
115119
router.push(`/manage/usecases/edit/${response.addUseCase.id}/details`);

0 commit comments

Comments
 (0)