mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Optional chaining used to enhance readability (#5961)
* Optional chaining used to enhance readability * Added Suggested change Co-authored-by: YashikaSarkar <65132044+YashikaSarkar@users.noreply.github.com>
This commit is contained in:
parent
41d25d54a7
commit
38181b2afa
@ -79,7 +79,7 @@ export default {
|
||||
const getNextPage = () => {
|
||||
this.loading = true
|
||||
api('listProjects', { listAll: true, details: 'min', page: page, pageSize: 500, showIcon: true }).then(json => {
|
||||
if (json && json.listprojectsresponse && json.listprojectsresponse.project) {
|
||||
if (json?.listprojectsresponse?.listprojectsresponse.project) {
|
||||
projects.push(...json.listprojectsresponse.project)
|
||||
}
|
||||
if (projects.length < json.listprojectsresponse.count) {
|
||||
|
||||
@ -155,7 +155,7 @@ export default {
|
||||
this.tableChanged = true
|
||||
},
|
||||
filterItems () {
|
||||
if (this.appliedFilterStatus && this.appliedFilterStatus.length > 0) {
|
||||
if (this.appliedFilterStatus?.length > 0) {
|
||||
this.filteredItems = this.selectedItems.filter(item => {
|
||||
if (this.appliedFilterStatus.includes(item.status)) {
|
||||
return item
|
||||
|
||||
@ -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) {
|
||||
this.dedicatedDomainId = response.listdedicatedzonesresponse.dedicatedzone[0].domainid
|
||||
this.dedicatedAccountId = response.listdedicatedzonesresponse.dedicatedzone[0].accountid
|
||||
}
|
||||
@ -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) {
|
||||
this.dedicatedDomainId = response.listdedicatedpodsresponse.dedicatedpod[0].domainid
|
||||
this.dedicatedAccountId = response.listdedicatedpodsresponse.dedicatedpod[0].accountid
|
||||
}
|
||||
@ -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) {
|
||||
this.dedicatedDomainId = response.listdedicatedclustersresponse.dedicatedcluster[0].domainid
|
||||
this.dedicatedAccountId = response.listdedicatedclustersresponse.dedicatedcluster[0].accountid
|
||||
}
|
||||
@ -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) {
|
||||
this.dedicatedDomainId = response.listdedicatedhostsresponse.dedicatedhost[0].domainid
|
||||
this.dedicatedAccountId = response.listdedicatedhostsresponse.dedicatedhost[0].accountid
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user