mhkadhum commented on code in PR #12124:
URL: https://github.com/apache/cloudstack/pull/12124#discussion_r2659500263
##########
ui/src/views/storage/UpdateBucket.vue:
##########
@@ -110,36 +132,31 @@ export default {
this.loading = true
Object.keys(this.apiParams).forEach(item => {
const field = this.apiParams[item]
- let fieldValue = null
- let fieldName = null
-
+ let fieldName = field.name
if (field.type === 'list' || field.name === 'account') {
fieldName = field.name.replace('ids', 'name').replace('id', 'name')
- } else {
- fieldName = field.name
}
- fieldValue = this.resource[fieldName] ? this.resource[fieldName] : null
- if (fieldValue) {
+ const fieldValue = this.resource[fieldName] ?? null
+ if (fieldValue !== null && fieldValue !== undefined) {
Review Comment:
u r correct with
`
const fieldValue = this.resource[fieldName] ?? null
`
fieldValue can never be undefined.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]