mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +00:00
fix: sql collection creation issue (#3087)
This commit is contained in:
parent
2630f25e51
commit
039deac92b
@ -9,9 +9,7 @@ import { useCompile } from '../../../../schema-component';
|
|||||||
import { useCollectionManager } from '../../../hooks';
|
import { useCollectionManager } from '../../../hooks';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { FieldOptions } from '@nocobase/database';
|
import { FieldOptions } from '@nocobase/database';
|
||||||
import { ResourceActionContext, useResourceContext } from '../../../ResourceActionProvider';
|
import { ResourceActionContext } from '../../../ResourceActionProvider';
|
||||||
import { useRecord } from '../../../../record-provider';
|
|
||||||
import { last } from 'lodash';
|
|
||||||
|
|
||||||
const inferInterface = (field: string, value: any) => {
|
const inferInterface = (field: string, value: any) => {
|
||||||
if (field.toLowerCase().includes('id')) {
|
if (field.toLowerCase().includes('id')) {
|
||||||
@ -24,7 +22,7 @@ const inferInterface = (field: string, value: any) => {
|
|||||||
return 'number';
|
return 'number';
|
||||||
}
|
}
|
||||||
if (typeof value === 'boolean') {
|
if (typeof value === 'boolean') {
|
||||||
return 'boolean';
|
return 'checkbox';
|
||||||
}
|
}
|
||||||
if (dayjs(value).isValid()) {
|
if (dayjs(value).isValid()) {
|
||||||
return 'datetime';
|
return 'datetime';
|
||||||
|
Loading…
Reference in New Issue
Block a user