@@ -19,16 +19,17 @@ import {
19
19
Tooltip ,
20
20
} from '@mantine/core' ;
21
21
import { FC , useCallback , useEffect , useState } from 'react' ;
22
- import styles from './styles/CreateStreamModal.module.css' ;
23
- import { useLogStream } from '@/hooks/useLogStream' ;
24
- import { useForm } from '@mantine/form' ;
22
+ import { GetInputPropsReturnType , UseFormReturnType } from 'node_modules/@mantine/form/lib/types' ;
25
23
import { IconInfoCircleFilled , IconPlus } from '@tabler/icons-react' ;
26
- import _ from 'lodash' ;
24
+ import { appStoreReducers , useAppStore } from '@/layouts/MainLayout/providers/AppProvider' ;
25
+
27
26
import { CreatableSelect } from '@/components/Misc/CreatableSelect' ;
28
- import { useAppStore , appStoreReducers } from '@/layouts/MainLayout/providers/AppProvider' ;
29
- import { GetInputPropsReturnType , UseFormReturnType } from 'node_modules/@mantine/form/lib/types' ;
30
- import { notifyError } from '@/utils/notification' ;
31
27
import { LogStreamSchemaData } from '@/@types/parseable/api/stream' ;
28
+ import _ from 'lodash' ;
29
+ import { notifyError } from '@/utils/notification' ;
30
+ import styles from './styles/CreateStreamModal.module.css' ;
31
+ import { useForm } from '@mantine/form' ;
32
+ import { useLogStream } from '@/hooks/useLogStream' ;
32
33
33
34
const { toggleCreateStreamModal } = appStoreReducers ;
34
35
@@ -461,9 +462,7 @@ const DetectSchemaSection = (props: { form: StreamFormType }) => {
461
462
} catch ( e ) {
462
463
console . error ( 'Error parsing json' , e ) ;
463
464
}
464
- if ( ! _ . isArray ( logRecords ) ) {
465
- return notifyError ( { message : 'Invalid JSON' } ) ;
466
- } else if ( _ . isEmpty ( logRecords ) ) {
465
+ if ( _ . isEmpty ( logRecords ) ) {
467
466
return notifyError ( { message : 'No records found' } ) ;
468
467
} else if ( _ . size ( logRecords ) > 10 ) {
469
468
return notifyError ( { message : 'More than 10 records found' } ) ;
0 commit comments