You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/02/08 03:21:40 UTC
[GitHub] [cloudstack] utchoang commented on a change in pull request #5961: Optional chaining used to enhance readability
utchoang commented on a change in pull request #5961:
URL: https://github.com/apache/cloudstack/pull/5961#discussion_r801235641
##########
File path: ui/src/components/view/DedicateData.vue
##########
@@ -147,8 +145,7 @@ export default {
api('listDedicatedClusters', {
clusterid: this.resource.id
}).then(response => {
- if (response.listdedicatedclustersresponse.dedicatedcluster &&
- response.listdedicatedclustersresponse.dedicatedcluster.length > 0) {
+ if (response.listdedicatedclustersresponse.dedicatedcluster?.length > 0) {
Review comment:
```suggestion
if (response?.listdedicatedclustersresponse?.dedicatedcluster?.length > 0) {
```
##########
File path: ui/src/components/view/DedicateData.vue
##########
@@ -121,8 +121,7 @@ export default {
api('listDedicatedZones', {
zoneid: this.resource.id
}).then(response => {
- if (response.listdedicatedzonesresponse.dedicatedzone &&
- response.listdedicatedzonesresponse.dedicatedzone.length > 0) {
+ if (response.listdedicatedzonesresponse.dedicatedzone?.length > 0) {
Review comment:
```suggestion
if (response?.listdedicatedzonesresponse?.dedicatedzone?.length > 0) {
```
##########
File path: ui/src/components/view/DedicateData.vue
##########
@@ -160,8 +157,7 @@ export default {
api('listDedicatedHosts', {
hostid: this.resource.id
}).then(response => {
- if (response.listdedicatedhostsresponse.dedicatedhost &&
- response.listdedicatedhostsresponse.dedicatedhost.length > 0) {
+ if (response.listdedicatedhostsresponse.dedicatedhost?.length > 0) {
Review comment:
```suggestion
if (response?.listdedicatedhostsresponse?.dedicatedhost?.length > 0) {
```
##########
File path: ui/src/components/view/DedicateData.vue
##########
@@ -134,8 +133,7 @@ export default {
api('listDedicatedPods', {
podid: this.resource.id
}).then(response => {
- if (response.listdedicatedpodsresponse.dedicatedpod &&
- response.listdedicatedpodsresponse.dedicatedpod.length > 0) {
+ if (response.listdedicatedpodsresponse.dedicatedpod?.length > 0) {
Review comment:
```suggestion
if (response?.listdedicatedpodsresponse?.dedicatedpod?.length > 0) {
```
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org