ImportDashboardForm: Add more meaningful error message for Editor user (#100581)

return error message when getting 403 during dashboard import
This commit is contained in:
Sergej-Vlasov
2025-02-19 10:03:37 +00:00
committed by GitHub
parent af261af7a7
commit e07b6efbc4
@@ -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;
});
};