Browse Source

fix: metaInsert2

pull/5444/head
Wing-Kam Wong 2 years ago
parent
commit
431115a53c
  1. 8
      packages/nocodb-nest/src/meta/meta.service.ts

8
packages/nocodb-nest/src/meta/meta.service.ts

@ -250,13 +250,15 @@ export class MetaService {
const insertObj = {
...data,
...(ignoreIdGeneration ? {} : { id }),
created_at: data?.created_at || this.knexConnection?.fn?.now(),
updated_at: data?.updated_at || this.knexConnection?.fn?.now(),
};
if (base_id !== null) insertObj.base_id = base_id;
if (project_id !== null) insertObj.project_id = project_id;
await this.knexConnection(target).insert(insertObj);
await this.knexConnection(target).insert({
...insertObj,
created_at: data?.created_at || this.knexConnection?.fn?.now(),
updated_at: data?.updated_at || this.knexConnection?.fn?.now(),
});
return insertObj;
}

Loading…
Cancel
Save