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

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Nov 7, 2024

fix: Job create cannot be saved without setting interval

@fit2bot fit2bot requested a review from a team November 7, 2024 09:58
@@ -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.

Copy link

sonarcloud bot commented Nov 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants