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";
|
import "../../elements/forms/HorizontalFormElement";
|
||||||
|
|
||||||
@customElement("ak-application-check-access-form")
|
@customElement("ak-application-check-access-form")
|
||||||
export class ApplicationCheckAccessForm extends Form<number> {
|
export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
|
||||||
|
|
||||||
@property({attribute: false})
|
@property({attribute: false})
|
||||||
application!: Application;
|
application!: Application;
|
||||||
|
@ -23,14 +23,19 @@ export class ApplicationCheckAccessForm extends Form<number> {
|
||||||
return t`Successfully sent test-request.`;
|
return t`Successfully sent test-request.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
send = (data: number): Promise<PolicyTestResult> => {
|
send = (data: { forUser: number }): Promise<PolicyTestResult> => {
|
||||||
this.request = data;
|
this.request = data.forUser;
|
||||||
return new CoreApi(DEFAULT_CONFIG).coreApplicationsCheckAccessRetrieve({
|
return new CoreApi(DEFAULT_CONFIG).coreApplicationsCheckAccessRetrieve({
|
||||||
slug: this.application?.slug,
|
slug: this.application?.slug,
|
||||||
forUser: data,
|
forUser: data.forUser,
|
||||||
}).then(result => this.result = result);
|
}).then(result => this.result = result);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resetForm(): void {
|
||||||
|
super.resetForm();
|
||||||
|
this.result = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
renderResult(): TemplateResult {
|
renderResult(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<ak-form-element-horizontal
|
<ak-form-element-horizontal
|
||||||
|
|
Reference in New Issue