* feat: wip refactor folder structure * Fix * fix position --------- Co-authored-by: Charles Bochet <charles@twenty.com>
21 lines
777 B
TypeScript
21 lines
777 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
|
|
import { CalendarEventService } from 'src/business/modules/calendar/repositories/calendar-event/calendar-event.service';
|
|
import { deleteUsingPagination } from 'src/business/modules/message/services/thread-cleaner/utils/delete-using-pagination.util';
|
|
|
|
@Injectable()
|
|
export class CalendarEventCleanerService {
|
|
constructor(private readonly calendarEventService: CalendarEventService) {}
|
|
|
|
public async cleanWorkspaceCalendarEvents(workspaceId: string) {
|
|
await deleteUsingPagination(
|
|
workspaceId,
|
|
500,
|
|
this.calendarEventService.getNonAssociatedCalendarEventIdsPaginated.bind(
|
|
this.calendarEventService,
|
|
),
|
|
this.calendarEventService.deleteByIds.bind(this.calendarEventService),
|
|
);
|
|
}
|
|
}
|