Initial commit with Email Import Wizard and Task Processor updates
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { Controller, Post, Logger, HttpCode, HttpStatus } from '@nestjs/common';
|
||||
import { RequirePermissions } from '../auth/permissions.decorator';
|
||||
import { Permission } from '../auth/permissions.enum';
|
||||
import { EmailDownloadService } from './email-download.service';
|
||||
|
||||
@Controller('api/emails')
|
||||
export class EmailDownloadController {
|
||||
private readonly logger = new Logger(EmailDownloadController.name);
|
||||
|
||||
constructor(private readonly emailDownloadService: EmailDownloadService) {}
|
||||
|
||||
@Post('fetch')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async triggerFetch() {
|
||||
this.logger.log('Manueller E-Mail-Abruf wurde ausgelöst.');
|
||||
await this.emailDownloadService.handleCron();
|
||||
return { message: 'E-Mail-Abruf abgeschlossen.' };
|
||||
}
|
||||
|
||||
@Post('backfill-thumbnails')
|
||||
@RequirePermissions(Permission.MANAGE_ALL)
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async backfillThumbnails() {
|
||||
this.logger.log('Manueller Backfill für Thumbnails wurde ausgelöst.');
|
||||
const result = await this.emailDownloadService.backfillThumbnailsForNewEmails();
|
||||
return { message: 'Backfill abgeschlossen.', result };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user