From 0587ab26e807bf81dcf9e8a27a7f7ba0392ac272 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 25 Jul 2021 21:03:32 +0200 Subject: [PATCH] web/admin: fix ApplicationView's CheckAccess not sending UserID correctly Signed-off-by: Jens Langhammer --- .../applications/ApplicationCheckAccessForm.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/src/pages/applications/ApplicationCheckAccessForm.ts b/web/src/pages/applications/ApplicationCheckAccessForm.ts index dbe330791..9d233e89b 100644 --- a/web/src/pages/applications/ApplicationCheckAccessForm.ts +++ b/web/src/pages/applications/ApplicationCheckAccessForm.ts @@ -8,7 +8,7 @@ import { until } from "lit-html/directives/until"; import "../../elements/forms/HorizontalFormElement"; @customElement("ak-application-check-access-form") -export class ApplicationCheckAccessForm extends Form { +export class ApplicationCheckAccessForm extends Form<{ forUser: number }> { @property({attribute: false}) application!: Application; @@ -23,14 +23,19 @@ export class ApplicationCheckAccessForm extends Form { return t`Successfully sent test-request.`; } - send = (data: number): Promise => { - this.request = data; + send = (data: { forUser: number }): Promise => { + this.request = data.forUser; return new CoreApi(DEFAULT_CONFIG).coreApplicationsCheckAccessRetrieve({ slug: this.application?.slug, - forUser: data, + forUser: data.forUser, }).then(result => this.result = result); }; + resetForm(): void { + super.resetForm(); + this.result = undefined; + } + renderResult(): TemplateResult { return html`