Skip to content

Commit e2fd2af

Browse files
committed
mark options as deprecated and avoid lint issue on the argument not used
1 parent 97046b9 commit e2fd2af

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/resources/resource.controller.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
CancelError,
1313
type ProblemDetails,
1414
} from '@umbraco-cms/backoffice/external/backend-api';
15+
import { UmbDeprecation } from '../utils/deprecation/deprecation.js';
1516

1617
export class UmbResourceController extends UmbControllerBase {
1718
#promise: Promise<any>;
@@ -48,11 +49,20 @@ export class UmbResourceController extends UmbControllerBase {
4849
/**
4950
* Wrap the {tryExecute} function in a try/catch block and return the result.
5051
* If the executor function throws an error, then show the details in a notification.
51-
* @param options
52+
* @param _options
5253
*/
54+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5355
async tryExecuteAndNotify<T>(options?: UmbNotificationOptions): Promise<UmbDataSourceResponse<T>> {
5456
const { data, error } = await UmbResourceController.tryExecute<T>(this.#promise);
5557

58+
if (options) {
59+
new UmbDeprecation({
60+
deprecated: 'tryExecuteAndNotify `options` argument is deprecated.',
61+
removeInVersion: '17.0.0',
62+
solution: 'Use the method without arguments.',
63+
}).warn();
64+
}
65+
5666
if (error) {
5767
/**
5868
* Determine if we want to show a notification or just log the error to the console.

0 commit comments

Comments
 (0)