Add viewField creation to fieldMetadata creation service (#2685)

* Add viewField creation to fieldMetadata creation service

* fix reduce with no initial value
This commit is contained in:
Weiko
2023-11-24 10:02:37 +01:00
committed by GitHub
parent c395955f12
commit cc526517b3
4 changed files with 53 additions and 14 deletions

View File

@ -54,6 +54,12 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
record.workspaceId,
);
if (record.labelSingular === record.labelPlural) {
throw new Error(
'The singular and plural labels cannot be the same for an object',
);
}
const createdObjectMetadata = await super.createOne({
...record,
dataSourceId: lastDataSourceMetadata.id,