From 92badd54f3c13c94408e5b3825e815942840bf7a Mon Sep 17 00:00:00 2001 From: Shams mosowi Date: Fri, 9 Oct 2020 15:25:10 +1100 Subject: [PATCH] actionScript:prevent updating cell value if there is no status --- www/src/components/Table/formatters/Action.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/www/src/components/Table/formatters/Action.tsx b/www/src/components/Table/formatters/Action.tsx index 6baa99fe..69c1ab56 100644 --- a/www/src/components/Table/formatters/Action.tsx +++ b/www/src/components/Table/formatters/Action.tsx @@ -82,7 +82,7 @@ export const ActionFab = ({ row, column, onSubmit, value }) => { message: JSON.stringify(message), severity: success ? "success" : "error", }); - if (cellValue) onSubmit(cellValue); + if (cellValue.status) onSubmit(cellValue); }, (error) => { console.error("ERROR", callableName, error); @@ -148,8 +148,6 @@ export default function Action({ onSubmit, }: CustomCellProps) { const classes = useStyles(); - - const { createdAt, updatedAt, id, ref, ...docData } = row; const { name } = column as any; const hasRan = value && value.status; return (