ImportDashboardForm: Add more meaningful error message for Editor user (#100581)
return error message when getting 403 during dashboard import
This commit is contained in:
1 parent
af261af7a7
commit
e07b6efbc4
1 file changed
+6
@@ -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