web/admin: fix ApplicationView's CheckAccess not sending UserID correctly
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
3c9cc9d421
commit
0587ab26e8
|
@ -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<number> {
|
||||
export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
|
||||
|
||||
@property({attribute: false})
|
||||
application!: Application;
|
||||
|
@ -23,14 +23,19 @@ export class ApplicationCheckAccessForm extends Form<number> {
|
|||
return t`Successfully sent test-request.`;
|
||||
}
|
||||
|
||||
send = (data: number): Promise<PolicyTestResult> => {
|
||||
this.request = data;
|
||||
send = (data: { forUser: number }): Promise<PolicyTestResult> => {
|
||||
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`
|
||||
<ak-form-element-horizontal
|
||||
|
|
Reference in a new issue