ImportDashboardForm: Add more meaningful error message for Editor user (#100581)
return error message when getting 403 during dashboard import
This commit is contained in:
@@ -53,6 +53,12 @@ export const validateUid = (value: string) => {
|
||||
})
|
||||
.catch((error) => {
|
||||
error.isHandled = true;
|
||||
|
||||
// when Editor user tries to import admin only dashboard (with same uid) he gets an unhelpful 403 error
|
||||
// therefore handling this use case to return some indication of whats wrong
|
||||
if (error.status === 403) {
|
||||
return 'Dashboard with the same UID already exists';
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user