web/admin: fix EventMatcherPolicyForm empty values (#6539)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-08-14 18:18:49 +01:00 committed by GitHub
parent 7cd7017d5f
commit 3040294e17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,10 @@ export class EventMatcherPolicyForm extends ModelForm<EventMatcherPolicy, string
} }
async send(data: EventMatcherPolicy): Promise<EventMatcherPolicy> { async send(data: EventMatcherPolicy): Promise<EventMatcherPolicy> {
if (data.action?.toString() === "") data.action = null;
if (data.clientIp?.toString() === "") data.clientIp = null;
if (data.app?.toString() === "") data.app = null;
if (data.model?.toString() === "") data.model = null;
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",