feat: エクスポート完了時に通知を発行するように (#14484)
* feat: エクスポート完了時に通知を発行するように * Update Changelog * entitity -> entity * fix: ペイロードを含むように * fix icon * exportableEntities -> userExportableEntities
This commit is contained in:
@@ -13,6 +13,7 @@ import type Logger from '@/logger.js';
|
||||
import { DriveService } from '@/core/DriveService.js';
|
||||
import { createTemp } from '@/misc/create-temp.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
import { NotificationService } from '@/core/NotificationService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||
import type * as Bull from 'bullmq';
|
||||
@@ -30,6 +31,7 @@ export class ExportBlockingProcessorService {
|
||||
private blockingsRepository: BlockingsRepository,
|
||||
|
||||
private utilityService: UtilityService,
|
||||
private notificationService: NotificationService,
|
||||
private driveService: DriveService,
|
||||
private queueLoggerService: QueueLoggerService,
|
||||
) {
|
||||
@@ -109,6 +111,11 @@ export class ExportBlockingProcessorService {
|
||||
const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'csv' });
|
||||
|
||||
this.logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
||||
this.notificationService.createNotification(user.id, 'exportCompleted', {
|
||||
exportedEntity: 'blocking',
|
||||
fileId: driveFile.id,
|
||||
});
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
|
Reference in New Issue
Block a user