Skip to content

Commit

Permalink
Restructure getEndpointIds to pass ui.test.js (#1483)
Browse files Browse the repository at this point in the history
- call API directly without action
- check if $serverGet defined before calling it
  • Loading branch information
ethanzhouyc authored Nov 15, 2024
1 parent 5289d6c commit 24ea807
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/components/ZclCreateModifyEndpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,11 @@ export default {
}
},
getEndpointIds() {
this.$store.dispatch('zap/getEndpointIds').then((res) => {
this.endpointIds = res.data
})
if (this.$serverGet != null) {
this.$serverGet(RestApi.uri.endpointIds).then((resp) => {
this.endpointIds = resp.data
})
}
},
// This function will close the endpoint modal
toggleCreateEndpointModal() {
Expand Down
8 changes: 0 additions & 8 deletions src/store/zap/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,6 @@ export function addEndpoint(context, newEndpointContext) {
})
}

/**
* Get endpoint ids.
* @returns endpoints ids
*/
export async function getEndpointIds() {
return await axiosRequests.$serverGet(restApi.uri.endpointIds)
}

/**
* Add endpoint type for ZAP UI.
* @param {*} context
Expand Down

0 comments on commit 24ea807

Please sign in to comment.