Use named arguments in onSubmit method

parent f9077b6a
...@@ -220,7 +220,7 @@ export default { ...@@ -220,7 +220,7 @@ export default {
}, },
}, },
methods: { methods: {
onSubmit(runAfterCreate = true, button = this.$options.saveAndRunScanBtnId) { onSubmit({ runAfterCreate = true, button = this.$options.saveAndRunScanBtnId } = {}) {
if (this.glFeatures.dastSavedScans) { if (this.glFeatures.dastSavedScans) {
this.form.showValidation = true; this.form.showValidation = true;
if (!this.form.state) { if (!this.form.state) {
...@@ -505,7 +505,7 @@ export default { ...@@ -505,7 +505,7 @@ export default {
data-testid="on-demand-scan-save-button" data-testid="on-demand-scan-save-button"
:disabled="isSaveButtonDisabled" :disabled="isSaveButtonDisabled"
:loading="loading === $options.saveScanBtnId" :loading="loading === $options.saveScanBtnId"
@click="onSubmit(false, $options.saveScanBtnId)" @click="onSubmit({ runAfterCreate: false, button: $options.saveScanBtnId })"
> >
{{ s__('OnDemandScans|Save scan') }} {{ s__('OnDemandScans|Save scan') }}
</gl-button> </gl-button>
......
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