Commit a5db2cc5 authored by Dheeraj Joshi's avatar Dheeraj Joshi

Move parsing to computed property

parent 77f8b9fa
...@@ -149,6 +149,11 @@ export default { ...@@ -149,6 +149,11 @@ export default {
isPolicyProfile() { isPolicyProfile() {
return Boolean(this.siteProfile?.referencedInSecurityPolicies?.length); return Boolean(this.siteProfile?.referencedInSecurityPolicies?.length);
}, },
parsedExcludedUrls() {
return this.form.fields.excludedUrls.value
.split(EXCLUDED_URLS_SEPARATOR)
.map((url) => url.trim());
},
}, },
async mounted() { async mounted() {
if (this.isEdit) { if (this.isEdit) {
...@@ -156,9 +161,6 @@ export default { ...@@ -156,9 +161,6 @@ export default {
} }
}, },
methods: { methods: {
parseExcludedUrls(input) {
return input.value.split(EXCLUDED_URLS_SEPARATOR).map((url) => url.trim());
},
onSubmit() { onSubmit() {
const isAuthEnabled = const isAuthEnabled =
this.glFeatures.securityDastSiteProfilesAdditionalFields && this.glFeatures.securityDastSiteProfilesAdditionalFields &&
...@@ -186,7 +188,7 @@ export default { ...@@ -186,7 +188,7 @@ export default {
...additionalFields, ...additionalFields,
auth: serializeFormObject(this.authSection.fields), auth: serializeFormObject(this.authSection.fields),
...(additionalFields.excludedUrls && { ...(additionalFields.excludedUrls && {
excludedUrls: this.parseExcludedUrls(this.form.fields.excludedUrls), excludedUrls: this.parsedExcludedUrls,
}), }),
}), }),
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment