Added isAuditLogged column to object-metadata-entity (#4898)
Added isAuditLogged column to object-metadata-entity.ts This is my first open source pull request. Please do let me know if made any mistake. I will be greatfull. Thank u --------- Co-authored-by: Félix Malfait <felix@twenty.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
import { TypedReflect } from 'src/utils/typed-reflect';
|
||||
|
||||
export function IsNotAuditLogged() {
|
||||
return function (target: object) {
|
||||
TypedReflect.defineMetadata('isAuditLogged', false, target);
|
||||
};
|
||||
}
|
||||
@ -8,6 +8,8 @@ export function ObjectMetadata(
|
||||
): ClassDecorator {
|
||||
return (target) => {
|
||||
const isSystem = TypedReflect.getMetadata('isSystem', target) ?? false;
|
||||
const isAuditLogged =
|
||||
TypedReflect.getMetadata('isAuditLogged', target) ?? true;
|
||||
const gate = TypedReflect.getMetadata('gate', target);
|
||||
const objectName = convertClassNameToObjectMetadataName(target.name);
|
||||
|
||||
@ -20,6 +22,7 @@ export function ObjectMetadata(
|
||||
isSystem,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isAuditLogged,
|
||||
description: params.description,
|
||||
icon: params.icon,
|
||||
gate,
|
||||
|
||||
@ -15,5 +15,6 @@ export interface ReflectObjectMetadata extends ObjectMetadataDecoratorParams {
|
||||
isSystem: boolean;
|
||||
isCustom: boolean;
|
||||
isRemote: boolean;
|
||||
isAuditLogged: boolean;
|
||||
gate?: GateDecoratorParams;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user