mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
handle delete cell errors
This commit is contained in:
@@ -301,7 +301,22 @@ export const ProjectContextProvider: React.FC = ({ children }) => {
|
||||
})
|
||||
.then(
|
||||
() => console.log("Field Value deleted"),
|
||||
(error) => console.error("Failed to delete", error)
|
||||
(error) => {
|
||||
if (error.code === "permission-denied") {
|
||||
enqueueSnackbar(
|
||||
`You do not have the permissions to make this change.`,
|
||||
{
|
||||
variant: "error",
|
||||
anchorOrigin: { horizontal: "center", vertical: "top" },
|
||||
}
|
||||
);
|
||||
} else {
|
||||
enqueueSnackbar(error.message, {
|
||||
variant: "error",
|
||||
anchorOrigin: { horizontal: "center", vertical: "top" },
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -335,6 +350,11 @@ export const ProjectContextProvider: React.FC = ({ children }) => {
|
||||
anchorOrigin: { horizontal: "center", vertical: "top" },
|
||||
}
|
||||
);
|
||||
} else {
|
||||
enqueueSnackbar(error.message, {
|
||||
variant: "error",
|
||||
anchorOrigin: { horizontal: "center", vertical: "top" },
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user