Remove success notification after document type export (#19151)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user