Delete message when no more association (#3701)

* Delete message when no more association

* remove unused injections

* rename methods

* fix after review
This commit is contained in:
Weiko
2024-01-30 17:58:36 +01:00
committed by GitHub
parent 8b9d62e425
commit 64b2ef3dc2
23 changed files with 501 additions and 201 deletions

View File

@ -0,0 +1,10 @@
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
// Note: This is actually not enterely correct, id field should only be added if the relation is MANY_TO_ONE or ONE_TO_ONE
export type ObjectRecord<T extends BaseObjectMetadata> = {
[K in keyof T as T[K] extends BaseObjectMetadata
? `${Extract<K, string>}Id`
: K]: T[K] extends BaseObjectMetadata ? string : T[K];
} & {
[K in keyof T]: T[K] extends BaseObjectMetadata ? ObjectRecord<T[K]> : T[K];
};