diff --git a/web/src/admin/applications/wizard/commit/ak-application-wizard-commit-application.ts b/web/src/admin/applications/wizard/commit/ak-application-wizard-commit-application.ts index 906856344..eaea1dfd3 100644 --- a/web/src/admin/applications/wizard/commit/ak-application-wizard-commit-application.ts +++ b/web/src/admin/applications/wizard/commit/ak-application-wizard-commit-application.ts @@ -24,7 +24,7 @@ import { TransactionApplicationRequest, TransactionApplicationResponse, } from "@goauthentik/api"; -import type { ModelRequest } from "@goauthentik/api"; +import type { ModelRequest, ResponseError } from "@goauthentik/api"; import BasePanel from "../BasePanel"; import providerModelsList from "../auth-method-choice/ak-application-wizard-authentication-method-choice.choices"; @@ -68,8 +68,8 @@ const successState: State = { icon: ["fa-check-circle", "pf-m-success"], }; -function extract(o: Record): string[] { - function inner(o: Record): string[] { +function extract(o: Record): string[] { + function inner(o: Record): string[] { if (typeof o !== "object") { return []; } @@ -77,7 +77,7 @@ function extract(o: Record): string[] { return o; } return Object.keys(o) - .map((k) => inner(o[k])) + .map((k) => inner(o[k] as Record)) .flat(); } return inner(o); @@ -168,8 +168,8 @@ export class ApplicationWizardCommitApplication extends BasePanel { this.dispatchWizardUpdate({ status: "submitted" }); this.commitState = successState; }) - .catch((resolution: any) => { - resolution.response.json().then((body: Record) => { + .catch((resolution: ResponseError) => { + resolution.response.json().then((body: Record) => { this.errors = extract(body); this.commitState = errorState; });