Skip to content
Merged
Changes from 1 commit
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 ui/src/views/compute/StartVirtualMachine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default {
id: this.resource.id
}
for (const key in values) {
if (values[key]) {
if (values[key] || values[key] === false) {
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we simply remove this if condition? I don't see how a form's field value could be null or undefined here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bernardodemarco It may be there because some fields may have an empty value which we shouldn't pass to the API

Copy link
Member

Choose a reason for hiding this comment

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

Okay. Specifically in this form, in which all fields are select components (except for the considerlasthost), the UI does not allow the values to be empty.

However, I think that's a great idea to keep the if statement how you proposed, since that we could, in the future, add more fields to the form that can accept empty/nullable values

params[key] = values[key]
}
}
Expand Down