User Settings
At this section you will find all personal settings. Some of them are standalone features, you can navigate to them through link bellow.
Last updated
const handleSwitchChange = async (value, type) => {
setLoading(prev => ({ ...prev, [type]: true }));
try {
switch (type) {
case 'impersonationAllowed':
await updateProfile({ impersonationAllowed: value });
break;
case 'tourCompleted':
await updateUserTourStatus();
fetchUser();
break;
default:
break;
}
setOptions(prevState => ({
...prevState,
[type]: value,
}));
globalNotification.open({
type: notificationType.SUCCESS,
message: t('notification.save-success.message'),
description: t('notification.save-success.description'),
placement: 'top',
});
} catch (err) {
const errorCode = err.response.data?.code;
globalNotification.open({
type: notificationType.ERROR,
message: t(`apiResponses:${errorCode}.message`),
description: t(`apiResponses:${errorCode}.description`),
placement: 'top',
});
} finally {
setLoading(prev => ({ ...prev, [type]: false }));
}
};