add new @WorkspaceIsSearchable decorator + updates services + add migration command (#10507)
closes https://github.com/twentyhq/core-team-issues/issues/345
This commit is contained in:
@ -37,6 +37,11 @@ export function WorkspaceEntity(
|
||||
'workspace:duplicate-criteria-metadata-args',
|
||||
target,
|
||||
);
|
||||
const isSearchable =
|
||||
TypedReflect.getMetadata(
|
||||
'workspace:is-searchable-metadata-args',
|
||||
target,
|
||||
) ?? false;
|
||||
|
||||
const objectName = convertClassNameToObjectMetadataName(target.name);
|
||||
|
||||
@ -57,6 +62,7 @@ export function WorkspaceEntity(
|
||||
isSystem,
|
||||
gate,
|
||||
duplicateCriteria,
|
||||
isSearchable,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||
|
||||
export function WorkspaceIsSearchable() {
|
||||
return function (target: any): void {
|
||||
TypedReflect.defineMetadata(
|
||||
'workspace:is-searchable-metadata-args',
|
||||
true,
|
||||
target,
|
||||
);
|
||||
};
|
||||
}
|
||||
@ -72,4 +72,9 @@ export interface WorkspaceEntityMetadataArgs {
|
||||
* Duplicate criteria.
|
||||
*/
|
||||
readonly duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
|
||||
/**
|
||||
* Is searchable object.
|
||||
*/
|
||||
readonly isSearchable: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user