typescript 4.4 fixes

This commit is contained in:
Sidney Alcantara
2021-09-09 18:58:54 +10:00
parent e7bfd4e943
commit 21d0f9405c

View File

@@ -254,7 +254,7 @@ const useTableData = (initialOverrides: any) => {
// delete document
try {
db.collection(tableState.path).doc(rowId).delete();
} catch (error) {
} catch (error: any) {
console.log(error);
if (error.code === "permission-denied") {
enqueueSnackbar("You do not have the permissions to delete rows.", {
@@ -304,7 +304,7 @@ const useTableData = (initialOverrides: any) => {
if (missingRequiredFields.length === 0) {
try {
await db.collection(path).doc(newId).set(docData, { merge: true });
} catch (error) {
} catch (error: any) {
if (error.code === "permission-denied") {
enqueueSnackbar("You do not have the permissions to add new rows.", {
variant: "error",