From de607882a16deff27a61dd842a2bd6c6f584e74a Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Tue, 30 Aug 2022 04:04:10 -0600 Subject: [PATCH] add edit and cancel functions --- .../web-react/src/components/RegistroComunicado.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web-ui/web-react/src/components/RegistroComunicado.js b/web-ui/web-react/src/components/RegistroComunicado.js index 023cd30b..b98a7c5f 100644 --- a/web-ui/web-react/src/components/RegistroComunicado.js +++ b/web-ui/web-react/src/components/RegistroComunicado.js @@ -112,6 +112,18 @@ const RegistroComunicado = () => { ) } + const edit = (rowData) => { + setComunicado(rowData); + setComunicadoId(rowData._id); + setSaveButtonLabel('Actualizar'); + } + + const cancelEdit = () => { + setComunicado(emptyComunicado); + setSaveButtonLabel('Registrar'); + setComunicadoId(null); + } + const actions = (rowData) => { return (