chore: Fix loading state in the inbox settings page (#4926)

This commit is contained in:
Pranav Raj S
2022-06-24 23:15:46 +05:30
committed by GitHub
parent 263b8240d3
commit c0249a1b5b
12 changed files with 106 additions and 97 deletions

View File

@@ -45,3 +45,13 @@ export const clearCookiesOnLogout = () => {
const logoutRedirectLink = globalConfig.LOGOUT_REDIRECT_LINK || '/';
window.location = logoutRedirectLink;
};
export const parseAPIErrorResponse = error => {
if (error?.response?.data?.message) {
return error?.response?.data?.message;
}
if (error?.response?.data?.error) {
return error?.response?.data?.error;
}
return error;
};