From 1518002957a3ef8d2af01b5a9e250dbc689937e0 Mon Sep 17 00:00:00 2001 From: mloweedgar Date: Tue, 8 Feb 2022 18:35:37 +0300 Subject: [PATCH] feat(log payment): use now() for payment data when logging single payment ref #345 --- .../common/CustomTableItemDetails/CustomTableItemDetails.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/CustomTableItemDetails/CustomTableItemDetails.js b/src/components/common/CustomTableItemDetails/CustomTableItemDetails.js index adf62cae8..b408dcdc5 100644 --- a/src/components/common/CustomTableItemDetails/CustomTableItemDetails.js +++ b/src/components/common/CustomTableItemDetails/CustomTableItemDetails.js @@ -36,8 +36,9 @@ function LogPaymentForm(props) { const handleOnFormSubmit = () => { const { id, worker_id, amount, currency } = selectedItem; + const paid_at = new Date(); earningsAPI - .patchEarning({ id, worker_id, amount, currency, ...payload }) + .patchEarning({ id, worker_id, amount, currency, paid_at, ...payload }) .then(() => refreshData()) .catch((e) => console.log('error logging payment', e)); closeForm();