0.2.0 cleaning script (#2342)

* Display maxUpdatedAt for each workspace Schema

* Factorize functions

* Add max update for public workspaces

* Merge everything in a single json

* Enrich results

* Get from proper table

* Update

* Move to proper command file

* Add a dry-run option

* Remove workspaces from database

* Fix DeleteWorkspace method

* Add new option

* Remove proper data when deleting workspace

* Minor improvements
This commit is contained in:
martmull
2023-11-06 23:15:02 +01:00
committed by GitHub
parent 377f95c9db
commit ba69435339
11 changed files with 337 additions and 75 deletions
@@ -24,8 +24,6 @@ import {
UpdateWorkspaceAbilityHandler,
DeleteWorkspaceAbilityHandler,
} from 'src/ability/handlers/workspace.ability-handler';
import { AuthUser } from 'src/decorators/auth-user.decorator';
import { User } from 'src/core/@generated/user/user.model';
@UseGuards(JwtAuthGuard)
@Resolver(() => Workspace)
@@ -108,12 +106,10 @@ export class WorkspaceResolver {
@AuthWorkspace() { id: workspaceId }: Workspace,
@PrismaSelector({ modelName: 'Workspace' })
{ value: select }: PrismaSelect<'Workspace'>,
@AuthUser() { id: userId }: User,
) {
return this.workspaceService.deleteWorkspace({
workspaceId,
select,
userId,
});
}
}