fix: missing options when finding

This commit is contained in:
chenos 2020-12-09 23:04:53 +08:00
parent 2828a82f7d
commit f948896365
2 changed files with 4 additions and 2 deletions

View File

@ -143,6 +143,7 @@ describe('collection hooks', () => {
});
expect(createdField.body).toMatchObject({
...types['string'].options,
...{
interface: 'string',
title: '名称',
@ -152,7 +153,6 @@ describe('collection hooks', () => {
sortable: true,
filterable: true,
},
...types['string'].options,
sort: 1,
collection_name: 'tests',
});

View File

@ -14,7 +14,8 @@ export class FieldModel extends BaseModel {
constructor(values: any = {}, options: any = {}) {
let data = {
...(values.options||{}),
..._.omit(values, 'options'),
...values,
// ..._.omit(values, 'options'),
};
const interfaceType = data.interface;
if (interfaceType) {
@ -25,6 +26,7 @@ export class FieldModel extends BaseModel {
}
// @ts-ignore
super(data, options);
// console.log(data);
}
generateName() {