Skip to content

Commit d930d31

Browse files
author
bhavabhuthi
committed
fix: merge dev branch
2 parents 07aa93d + 42d0bca commit d930d31

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

  • app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components

app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/EditResource.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { GraphQL } from '@/lib/api';
2525
import { Icons } from '@/components/icons';
2626
import { createResourceFilesDoc } from './DistributionList';
2727
import { ResourceSchema } from './ResourceSchema';
28+
import { ResourceSchema } from './ResourceSchema';
2829

2930
interface TListItem {
3031
label: string;
@@ -35,8 +36,9 @@ interface TListItem {
3536
}
3637

3738
export const EditResource = ({ reload, data }: any) => {
38-
const params = useParams();
3939

40+
const params = useParams();
41+
4042
const updateResourceDoc: any = graphql(`
4143
mutation updateFileResource($fileResourceInput: UpdateFileResourceInput!) {
4244
updateFileResource(fileResourceInput: $fileResourceInput) {
@@ -90,6 +92,25 @@ export const EditResource = ({ reload, data }: any) => {
9092
() => GraphQL(fetchSchema, { datasetId: params.id })
9193
);
9294

95+
const fetchSchema: any = graphql(`
96+
query datasetSchema($datasetId: UUID!) {
97+
datasetResources(datasetId: $datasetId) {
98+
schema {
99+
id
100+
fieldName
101+
format
102+
description
103+
}
104+
id
105+
}
106+
}
107+
`);
108+
109+
const { data: payload, refetch, isLoading: isPending,} = useQuery<any>(
110+
[`fetch_schema_${params.id}`],
111+
() => GraphQL(fetchSchema, { datasetId: params.id })
112+
);
113+
93114
const { mutate: transform } = useMutation(
94115
(data: { fileResourceInput: CreateFileResourceInput }) =>
95116
GraphQL(createResourceFilesDoc, data),

0 commit comments

Comments
 (0)