feat: soft delete (#6576)
Implement soft delete on standards and custom objects. This is a temporary solution, when we drop `pg_graphql` we should rely on the `softDelete` functions of TypeORM. --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -53,6 +53,7 @@ export const BASE_OBJECT_STANDARD_FIELD_IDS = {
|
||||
id: '20202020-eda0-4cee-9577-3eb357e3c22b',
|
||||
createdAt: '20202020-66ac-4502-9975-e4d959c50311',
|
||||
updatedAt: '20202020-d767-4622-bdcf-d8a084834d86',
|
||||
deletedAt: '20202020-b9a7-48d8-8387-b9a3090a50ec',
|
||||
};
|
||||
|
||||
export const BLOCKLIST_STANDARD_FIELD_IDS = {
|
||||
|
||||
@ -150,6 +150,14 @@ export class StandardFieldFactory {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (
|
||||
workspaceFieldMetadataArgs.name === 'deletedAt' &&
|
||||
workspaceEntityMetadataArgs &&
|
||||
!workspaceEntityMetadataArgs.softDelete
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
type: workspaceFieldMetadataArgs.type,
|
||||
|
||||
@ -54,6 +54,7 @@ export class StandardObjectFactory {
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isSystem: workspaceEntityMetadataArgs.isSystem ?? false,
|
||||
isSoftDeletable: workspaceEntityMetadataArgs.softDelete ?? false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user