mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:36:42 +00:00
fix: missing options when finding
This commit is contained in:
parent
2828a82f7d
commit
f948896365
@ -143,6 +143,7 @@ describe('collection hooks', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(createdField.body).toMatchObject({
|
expect(createdField.body).toMatchObject({
|
||||||
|
...types['string'].options,
|
||||||
...{
|
...{
|
||||||
interface: 'string',
|
interface: 'string',
|
||||||
title: '名称',
|
title: '名称',
|
||||||
@ -152,7 +153,6 @@ describe('collection hooks', () => {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
...types['string'].options,
|
|
||||||
sort: 1,
|
sort: 1,
|
||||||
collection_name: 'tests',
|
collection_name: 'tests',
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,8 @@ export class FieldModel extends BaseModel {
|
|||||||
constructor(values: any = {}, options: any = {}) {
|
constructor(values: any = {}, options: any = {}) {
|
||||||
let data = {
|
let data = {
|
||||||
...(values.options||{}),
|
...(values.options||{}),
|
||||||
..._.omit(values, 'options'),
|
...values,
|
||||||
|
// ..._.omit(values, 'options'),
|
||||||
};
|
};
|
||||||
const interfaceType = data.interface;
|
const interfaceType = data.interface;
|
||||||
if (interfaceType) {
|
if (interfaceType) {
|
||||||
@ -25,6 +26,7 @@ export class FieldModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
super(data, options);
|
super(data, options);
|
||||||
|
// console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
generateName() {
|
generateName() {
|
||||||
|
Loading…
Reference in New Issue
Block a user