Skip to content

Commit e8b907d

Browse files
authored
Merge pull request #4 from fullstacklabs/GDCM-716
GDCM-716 Added schema for default schema
2 parents 4b507d4 + c13c80d commit e8b907d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/schema/fieldSchema.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { fieldTextSchema } from './fieldTextSchema'
2-
import { fieldSelectSchema } from './fieldSelectSchema'
3-
import { fieldDateSchema } from './fieldDateSchema'
4-
import { fieldImageSchema } from './fieldImageSchema'
5-
import { fieldNumberSchema } from './fieldNumberSchema'
6-
import { fieldCodeSchema } from './fieldCodeSchema'
7-
import { fieldSignatureSchema } from './fieldSignatureSchema'
8-
import { filedGPSSchema } from './filedGPSSchema'
9-
import { dynamicListFieldSchema } from './dynamicListFieldSchema'
1+
import * as Yup from 'yup'
2+
import { fieldTextSchema } from './fieldTextSchema';
3+
import { fieldSelectSchema } from './fieldSelectSchema';
4+
import { fieldDateSchema } from './fieldDateSchema';
5+
import { fieldImageSchema } from './fieldImageSchema';
6+
import { fieldNumberSchema } from './fieldNumberSchema';
7+
import { fieldCodeSchema } from './fieldCodeSchema';
8+
import { fieldSignatureSchema } from './fieldSignatureSchema';
9+
import { filedGPSSchema } from './filedGPSSchema';
10+
import { dynamicListFieldSchema } from './dynamicListFieldSchema';
1011

1112
export const fieldSchema = (field) => {
1213
switch (field.fieldType) {
@@ -35,6 +36,6 @@ export const fieldSchema = (field) => {
3536
case 'dynamicList':
3637
return dynamicListFieldSchema(field)
3738
default:
38-
return {}
39+
return { schema: Yup.object().shape({}).noUnknown() };
3940
}
4041
}

0 commit comments

Comments
 (0)