From 3302aae1fcd53efff62c70e7fd170ae566bf209a Mon Sep 17 00:00:00 2001 From: alipov_d Date: Tue, 14 Nov 2023 16:35:19 +0200 Subject: [PATCH] fix: request error for empty user list responses --- src/containers/ListView/TableAction.jsx | 1 + .../__snapshots__/TableAction.test.jsx.snap | 1 + src/data/redux/thunkActions/grading.js | 8 +++++--- src/data/redux/thunkActions/grading.test.js | 17 +++++++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/containers/ListView/TableAction.jsx b/src/containers/ListView/TableAction.jsx index 44886d3ff..40a800e1d 100644 --- a/src/containers/ListView/TableAction.jsx +++ b/src/containers/ListView/TableAction.jsx @@ -11,6 +11,7 @@ export const TableAction = ({ tableInstance, handleClick }) => ( onClick={handleClick(tableInstance.rows)} variant="primary" className="view-all-responses-btn" + disabled={tableInstance.rows.length === 0} > diff --git a/src/containers/ListView/__snapshots__/TableAction.test.jsx.snap b/src/containers/ListView/__snapshots__/TableAction.test.jsx.snap index 5b3144673..0d3eb462b 100644 --- a/src/containers/ListView/__snapshots__/TableAction.test.jsx.snap +++ b/src/containers/ListView/__snapshots__/TableAction.test.jsx.snap @@ -3,6 +3,7 @@ exports[`TableAction component snapshots 1`] = `