2023-01-03 14:20:50 +01:00
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2023-01-20 13:28:41 +01:00
|
|
|
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
2023-01-23 15:12:48 +01:00
|
|
|
import type { UmbNotificationOptions } from '@umbraco-cms/notification';
|
2023-01-23 14:28:53 +01:00
|
|
|
import { UmbResourceController } from './resource.controller';
|
2023-01-02 14:55:46 +01:00
|
|
|
|
2023-01-03 15:52:23 +01:00
|
|
|
export function tryExecuteAndNotify<T>(
|
2023-01-02 22:33:49 +01:00
|
|
|
host: UmbControllerHostInterface,
|
|
|
|
|
resource: Promise<T>,
|
|
|
|
|
options?: UmbNotificationOptions<any>
|
2023-01-03 15:52:23 +01:00
|
|
|
) {
|
|
|
|
|
return new UmbResourceController(host, resource).tryExecuteAndNotify<T>(options);
|
2023-01-02 22:33:49 +01:00
|
|
|
}
|