Skip to content

Commit f09e788

Browse files
committed
refactor(ResourceListView): improve error handling and reorganize imports
1 parent cc1123a commit f09e788

File tree

1 file changed

+6
-6
lines changed
  • app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/resources/components

1 file changed

+6
-6
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/resources/components/ResourceListView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import React from 'react';
2-
import { useParams, useRouter } from 'next/navigation';
31
import { CreateFileResourceInput } from '@/gql/generated/graphql';
42
import { useMutation } from '@tanstack/react-query';
53
import { parseAsString, useQueryState } from 'next-usequerystate';
4+
import { useParams, useRouter } from 'next/navigation';
65
import {
76
Button,
87
DataTable,
@@ -13,11 +12,12 @@ import {
1312
Text,
1413
toast,
1514
} from 'opub-ui';
15+
import React from 'react';
1616

17-
import { GraphQL } from '@/lib/api';
18-
import { formatDate } from '@/lib/utils';
1917
import { Icons } from '@/components/icons';
2018
import { Loading } from '@/components/loading';
19+
import { GraphQL } from '@/lib/api';
20+
import { formatDate } from '@/lib/utils';
2121
import { createResourceFilesDoc, updateResourceList } from './query';
2222

2323
type FilteredRow = {
@@ -67,7 +67,7 @@ export const ResourceListView = ({ data, refetch }: ResourceListProps) => {
6767
});
6868
},
6969
onError: (err: any) => {
70-
console.log('Error ::: ', err);
70+
toast( err);
7171
},
7272
}
7373
);
@@ -109,7 +109,7 @@ export const ResourceListView = ({ data, refetch }: ResourceListProps) => {
109109
);
110110
},
111111
onError: (err: any) => {
112-
toast(err.message || String(err));
112+
toast(err);
113113
setFile([])
114114
}
115115

0 commit comments

Comments
 (0)