feat: show the full work history and load every lead stage on the board
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,6 +22,10 @@ class ListDeletionsQueryDto {
|
||||
@IsString()
|
||||
q?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
deletedById?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -47,7 +51,7 @@ export class DeletionsController {
|
||||
constructor(private readonly deletions: DeletionsService) {}
|
||||
|
||||
@Get()
|
||||
@Roles('owner', 'admin')
|
||||
@Roles('owner')
|
||||
list(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Query() query: ListDeletionsQueryDto,
|
||||
@@ -57,11 +61,12 @@ export class DeletionsController {
|
||||
query.page,
|
||||
query.limit,
|
||||
query.q,
|
||||
query.deletedById,
|
||||
);
|
||||
}
|
||||
|
||||
@Patch('settings')
|
||||
@Roles('owner', 'admin')
|
||||
@Roles('owner')
|
||||
updateSettings(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: RetentionDto,
|
||||
@@ -70,7 +75,7 @@ export class DeletionsController {
|
||||
}
|
||||
|
||||
@Post(':id/restore')
|
||||
@Roles('owner', 'admin')
|
||||
@Roles('owner')
|
||||
restore(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('id') id: string,
|
||||
@@ -79,7 +84,7 @@ export class DeletionsController {
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@Roles('owner', 'admin')
|
||||
@Roles('owner')
|
||||
purge(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('id') id: string,
|
||||
|
||||
@@ -30,12 +30,20 @@ const RETENTION_DAYS: Record<DeletionRetention, number | null> = {
|
||||
export class DeletionsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async list(organizationId: string, page = 1, limit = 30, q?: string) {
|
||||
async list(
|
||||
organizationId: string,
|
||||
page = 1,
|
||||
limit = 30,
|
||||
q?: string,
|
||||
deletedById?: string,
|
||||
) {
|
||||
const take = Math.min(100, Math.max(1, limit));
|
||||
const skip = (Math.max(1, page) - 1) * take;
|
||||
const query = q?.trim();
|
||||
const actorId = deletedById?.trim();
|
||||
const where = {
|
||||
organizationId,
|
||||
...(actorId ? { deletedById: actorId } : {}),
|
||||
...(query
|
||||
? {
|
||||
OR: [
|
||||
|
||||
Reference in New Issue
Block a user