web: mass update API calls
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -29,11 +29,11 @@ export class PropertyMappingLDAPForm extends ModelForm<LDAPPropertyMapping, stri
|
||||
if (this.instance) {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({
|
||||
pmUuid: this.instance.pk || "",
|
||||
data: data
|
||||
lDAPPropertyMappingRequest: data
|
||||
});
|
||||
} else {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapCreate({
|
||||
data: data
|
||||
lDAPPropertyMappingRequest: data
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -28,11 +28,11 @@ export class PropertyMappingLDAPForm extends ModelForm<SAMLPropertyMapping, stri
|
||||
if (this.instance) {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({
|
||||
pmUuid: this.instance.pk || "",
|
||||
data: data
|
||||
sAMLPropertyMappingRequest: data
|
||||
});
|
||||
} else {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlCreate({
|
||||
data: data
|
||||
sAMLPropertyMappingRequest: data
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -29,11 +29,11 @@ export class PropertyMappingScopeForm extends ModelForm<ScopeMapping, string> {
|
||||
if (this.instance) {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({
|
||||
pmUuid: this.instance.pk || "",
|
||||
data: data
|
||||
scopeMappingRequest: data
|
||||
});
|
||||
} else {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeCreate({
|
||||
data: data
|
||||
scopeMappingRequest: data
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { CoreApi, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api";
|
||||
import { CoreApi, PolicyTestRequest, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api";
|
||||
import { t } from "@lingui/macro";
|
||||
import { customElement, property } from "lit-element";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
@ -8,11 +8,10 @@ import { until } from "lit-html/directives/until";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../elements/forms/HorizontalFormElement";
|
||||
import "../../elements/CodeMirror";
|
||||
import { PolicyTest } from "authentik-api/src";
|
||||
import YAML from "yaml";
|
||||
|
||||
@customElement("ak-property-mapping-test-form")
|
||||
export class PolicyTestForm extends Form<PolicyTest> {
|
||||
export class PolicyTestForm extends Form<PolicyTestRequest> {
|
||||
|
||||
@property({attribute: false})
|
||||
mapping?: PropertyMapping;
|
||||
@ -24,10 +23,10 @@ export class PolicyTestForm extends Form<PolicyTest> {
|
||||
return t`Successfully sent test-request.`;
|
||||
}
|
||||
|
||||
send = (data: PolicyTest): Promise<PropertyMappingTestResult> => {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTest({
|
||||
send = (data: PolicyTestRequest): Promise<PropertyMappingTestResult> => {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTestCreate({
|
||||
pmUuid: this.mapping?.pk || "",
|
||||
data: data,
|
||||
policyTestRequest: data,
|
||||
formatResult: true,
|
||||
}).then(result => this.result = result);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user