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:
@ -15,6 +15,8 @@ describe('getResolverName', () => {
|
||||
['createOne', 'createEntity'],
|
||||
['updateOne', 'updateEntity'],
|
||||
['deleteOne', 'deleteEntity'],
|
||||
['restoreMany', 'restoreEntities'],
|
||||
['destroyMany', 'destroyEntities'],
|
||||
])('should return correct name for %s resolver', (type, expectedResult) => {
|
||||
expect(
|
||||
getResolverName(metadata, type as WorkspaceResolverBuilderMethodNames),
|
||||
|
||||
@ -25,8 +25,12 @@ export const getResolverName = (
|
||||
return `delete${pascalCase(objectMetadata.nameSingular)}`;
|
||||
case 'updateMany':
|
||||
return `update${pascalCase(objectMetadata.namePlural)}`;
|
||||
case 'restoreMany':
|
||||
return `restore${pascalCase(objectMetadata.namePlural)}`;
|
||||
case 'deleteMany':
|
||||
return `delete${pascalCase(objectMetadata.namePlural)}`;
|
||||
case 'destroyMany':
|
||||
return `destroy${pascalCase(objectMetadata.namePlural)}`;
|
||||
default:
|
||||
throw new Error(`Unknown resolver type: ${type}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user