web/admin: migrate api calls to async (#4335)
migrate api calls to async Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -39,14 +39,13 @@ export class PolicyTestForm extends Form<PolicyTestRequest> {
|
||||
return t`Successfully sent test-request.`;
|
||||
}
|
||||
|
||||
send = (data: PolicyTestRequest): Promise<PolicyTestResult> => {
|
||||
send = async (data: PolicyTestRequest): Promise<PolicyTestResult> => {
|
||||
this.request = data;
|
||||
return new PoliciesApi(DEFAULT_CONFIG)
|
||||
.policiesAllTestCreate({
|
||||
policyUuid: this.policy?.pk || "",
|
||||
policyTestRequest: data,
|
||||
})
|
||||
.then((result) => (this.result = result));
|
||||
const result = await new PoliciesApi(DEFAULT_CONFIG).policiesAllTestCreate({
|
||||
policyUuid: this.policy?.pk || "",
|
||||
policyTestRequest: data,
|
||||
});
|
||||
return (this.result = result);
|
||||
};
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
|
||||
Reference in New Issue
Block a user