Skip to content

Commit 6baee41

Browse files
committed
documentation
1 parent 9124907 commit 6baee41

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/apps/app/api-interceptor.controller.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ import {
88
UMB_NOTIFICATION_HEADER,
99
} from '@umbraco-cms/backoffice/notification';
1010

11+
/**
12+
* Controller that adds interceptors to the OpenAPI client
13+
*/
1114
export class UmbApiInterceptorController extends UmbControllerBase {
1215
constructor(host: UmbControllerHost) {
1316
super(host);
14-
this.#addApiInterceptor();
17+
this.#addUmbNotificationsInterceptor();
1518
}
1619

17-
#addApiInterceptor() {
20+
/**
21+
* Interceptor which takes in the umb-notifications and displays the notifications, if any.
22+
*/
23+
#addUmbNotificationsInterceptor() {
1824
OpenAPI.interceptors.response.use((response) => {
1925
const umbNotifications = response.headers.get(UMB_NOTIFICATION_HEADER);
2026
if (!umbNotifications) return response;

0 commit comments

Comments
 (0)