Files
twenty/packages/twenty-server/src/business/modules/calendar/services/calendar-event-cleaner/calendar-event-cleaner.service.ts
Jérémy M 94487f6737 feat: refactor folder structure (#4498)
* feat: wip refactor folder structure

* Fix

* fix position

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-03-15 14:40:58 +01:00

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),
);
}
}