Remove success notification after document type export (#19151)

This commit is contained in:
Mads Rasmussen
2025-04-25 12:18:06 +02:00
committed by GitHub
parent 0349dce9c4
commit 6db062cb7a

View File

@@ -1,23 +1,11 @@
import { UmbExportDocumentTypeServerDataSource } from './document-type-export.server.data-source.js';
import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification';
import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository';
export class UmbExportDocumentTypeRepository extends UmbRepositoryBase {
#exportSource = new UmbExportDocumentTypeServerDataSource(this);
async requestExport(unique: string) {
const { data, error } = await this.#exportSource.export(unique);
if (!error) {
const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT);
if (!notificationContext) {
throw new Error('Notification context not found');
}
const notification = { data: { message: `Exported` } };
notificationContext.peek('positive', notification);
}
return { data, error };
return this.#exportSource.export(unique);
}
}