Fixes error warnings for role edition form. #870

This commit is contained in:
mateuswetah 2024-05-17 11:18:14 -03:00
parent adde951dbf
commit 21144997d3
2 changed files with 6 additions and 6 deletions

View File

@ -38,12 +38,12 @@ export const tainacanErrorHandler = function(error) {
console.log('Tainacan Error Handler: ', error.response); 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 // The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js // http.ClientRequest in node.js
console.error('Tainacan Error Handler: ', error.request); console.error('Tainacan Error Handler: ', error.request);
} else { } else if ( error.message ) {
// Something happened in setting up the request that triggered an Error // Something happened in setting up the request that triggered an Error
console.error('Tainacan Error Handler: ', error.message); console.error('Tainacan Error Handler: ', error.message);
} }

View File

@ -69,8 +69,8 @@ export const createRole = ({ commit }, role) => {
resolve(role); resolve(role);
}) })
.catch((error) => { .catch((error) => {
if (error.response) if (error.error && error.error.response && error.error.response.data)
reject(error.response.data); reject(error.error.response.data);
}); });
}); });
}; };
@ -86,8 +86,8 @@ export const updateRole = ({ commit }, role) => {
resolve(updatedRole); resolve(updatedRole);
}) })
.catch(error => { .catch(error => {
if (error.response) if (error.error && error.error.response && error.error.response.data)
reject(error.response.data); reject(error.error.response.data);
}); });
}); });
}; };