Skip to content

Commit

Permalink
fix: axios data response
Browse files Browse the repository at this point in the history
  • Loading branch information
NichArchA82 committed Jan 8, 2025
1 parent 3f0848e commit bb91ec8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command-handler/src/util/libvirt/libvirt-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default {
selectRegion: async ({app, body }) => {
const buttonsArray = [];
//get the regions from the env variable
const regions = await axios.get(`${process.env.PROVISIONER_URL}/v1/regions`, {
const response = await axios.get(`${process.env.PROVISIONER_URL}/v1/regions`, {
headers: {
'Authorization': `${process.env.PROVISIONER_API_TOKEN}`
},
Expand All @@ -294,6 +294,8 @@ export default {
.catch(error => {
log.error('Failed to get regions from libvirt', axiosError(error));
});

const regions = response?.data;

//return if it fails to get a response from libvirt.
if (!regions) {
Expand Down

0 comments on commit bb91ec8

Please sign in to comment.