Skip to content

Commit

Permalink
Merge pull request #75 from louishourcade/bug/table-column-description
Browse files Browse the repository at this point in the history
Fix issue when trying to edit table column description
  • Loading branch information
dlpzx authored Jul 4, 2022
2 parents 7300220 + de58054 commit 6201897
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/src/views/Tables/TableColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ const TableColumns = (props) => {
}
};

const handleEditCellChangeCommitted = ({ id, field, props }) => {
/*eslint-disable-line*/
const data = props;
if (field === 'description') {
const handleEditCellChangeCommitted = (e:GridCellEditCommitParams) => {
const data = e.value;
if (e.field === 'description') {
columns.map((c) => {
if (c.id === id) {
return updateDescription(c, data.value.toString()).catch((e) =>
if (c.id === e.id && data.toString() !== c.description) {
c.description = data.toString();
return updateDescription(c, data.toString()).catch((e) =>
dispatch({ type: SET_ERROR, error: e.message })
);
}
Expand Down Expand Up @@ -171,7 +171,7 @@ const TableColumns = (props) => {
<DataGrid
rows={columns}
columns={header}
onEditCellChangeCommitted={handleEditCellChangeCommitted}
onCellEditCommit={handleEditCellChangeCommitted}
/>
)}
</Card>
Expand Down

0 comments on commit 6201897

Please sign in to comment.