Skip to content

Commit

Permalink
Fixes error warnings for role edition form. #870
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuswetah committed May 17, 2024
1 parent adde951 commit 2114499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/views/admin/js/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export const tainacanErrorHandler = function(error) {
console.log('Tainacan Error Handler: ', error.response);
}

} else if ('Tainacan Error Handler: ', error.request) {
} else if ( error.request ) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.error('Tainacan Error Handler: ', error.request);
} else {
} else if ( error.message ) {
// Something happened in setting up the request that triggered an Error
console.error('Tainacan Error Handler: ', error.message);
}
Expand Down
8 changes: 4 additions & 4 deletions src/views/admin/js/store/modules/capability/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const createRole = ({ commit }, role) => {
resolve(role);
})
.catch((error) => {
if (error.response)
reject(error.response.data);
if (error.error && error.error.response && error.error.response.data)
reject(error.error.response.data);
});
});
};
Expand All @@ -86,8 +86,8 @@ export const updateRole = ({ commit }, role) => {
resolve(updatedRole);
})
.catch(error => {
if (error.response)
reject(error.response.data);
if (error.error && error.error.response && error.error.response.data)
reject(error.error.response.data);
});
});
};
Expand Down

0 comments on commit 2114499

Please sign in to comment.