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: Job create cannot be saved without setting interval #4423

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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/accounts/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
import store from '@/store'

const validatorInterval = (rule, value, callback) => {
if (isNaN(parseInt(value, 10)) || parseInt(value) < 1) {
if (!isNaN(parseInt(value, 10)) && parseInt(value) < 1) {
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
}
callback()

Choose a reason for hiding this comment

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

The only difference between the two versions of the given code snippet is:

  • The first version uses parseInt(value) to convert the string "value" into a number.

  • The second version does not use this conversion method; it directly checks whether the input value is less than zero.

The implementation details should be optimized based on specific requirements or best practices:

  • If the function receives negative numbers, make sure it handles them correctly;
  • Consider adding comments to explain what each part of the script actually does. This will help with future reading and understanding;

Since there doesn't seem to be a significant flaw in logic or structure that would necessitate an optimization here, no further changes beyond these clarifications would significantly benefit the current setup unless more context was provided about the exact conditions under which the functions might need such adjustments.

Expand Down