Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Execute after save sometimes the variable is undefine. #4528

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/views/ops/Job/JobUpdateCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default {
callback: (value, form, btn) => {
form.value.run_after_save = true
const parameters = form.value.variable.reduce((acc, item) => {
acc[item.var_name] = item.default_value
acc[item.var_name] = item.default_value || ''
return acc
}, {})
form.value['parameters'] = parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There do not appear to be any specific issues or optimizations present in this snippet of code; it's well formatted and does what it's supposed to accomplish. The variables form, value and various function names have been declared with clear and concise syntaxes that make their purpose easily understandable.

The only change I notice is using the ternary operator (? :) instead of short circuits (??), which can improve readability depending on whether you prefer clarity over efficiency.

Here is a summary of my observations:

No major errors

Some stylistic improvements (using ternary operators)

No optimization concerns

Please review this for any other potential issues and request modifications if necessary.

Expand Down
Loading