mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:25:15 +00:00
fix: autoGenId default value should be false when adding collection (#4942)
* fix: autoGenId default value should be false when adding collection * fix: test
This commit is contained in:
parent
bd5d4489fd
commit
47d2a0ee61
@ -169,7 +169,7 @@ export const PresetFields = observer(
|
||||
];
|
||||
useEffect(() => {
|
||||
const config = {
|
||||
autoGenId: true,
|
||||
autoGenId: false,
|
||||
createdAt: true,
|
||||
createdBy: true,
|
||||
updatedAt: true,
|
||||
@ -209,7 +209,7 @@ export const PresetFields = observer(
|
||||
onChange: (_, selectedRows) => {
|
||||
const fields = getDefaultCollectionFields(selectedRows, form.values);
|
||||
const config = {
|
||||
autoGenId: !!fields.find((v) => v.name === 'id'),
|
||||
autoGenId: false,
|
||||
createdAt: !!fields.find((v) => v.name === 'createdAt'),
|
||||
createdBy: !!fields.find((v) => v.name === 'createdBy'),
|
||||
updatedAt: !!fields.find((v) => v.name === 'updatedAt'),
|
||||
|
@ -26,7 +26,7 @@ test.describe('create collection with preset fields', () => {
|
||||
const postData = request.postDataJSON();
|
||||
//默认提交的数据符合预期
|
||||
expect(postData).toMatchObject({
|
||||
autoGenId: true,
|
||||
autoGenId: false,
|
||||
createdAt: true,
|
||||
createdBy: true,
|
||||
updatedAt: true,
|
||||
@ -78,7 +78,7 @@ test.describe('create collection with preset fields', () => {
|
||||
const postData = request.postDataJSON();
|
||||
//提交的数据符合预期
|
||||
expect(postData).toMatchObject({
|
||||
autoGenId: true,
|
||||
autoGenId: false,
|
||||
createdAt: false,
|
||||
createdBy: false,
|
||||
updatedAt: false,
|
||||
|
Loading…
Reference in New Issue
Block a user