From 1fc6eed1d5309706cfbe6f0306f0aa063321a44b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 28 Mar 2024 08:31:55 -0300 Subject: [PATCH] Clean props when switching between edit and create mode in WorkerTimeForm --- src/pages/Worker/Card/WorkerTimeControl.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index fcaf09825..8b89a8ede 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -355,11 +355,11 @@ const getMailStates = async (date) => { }; const showWorkerTimeForm = (propValue, formType) => { - if (formType === 'edit') { - workerTimeFormProps.entryId = propValue; - } else { - workerTimeFormProps.dated = propValue; - } + const isEditForm = formType === 'edit'; + + workerTimeFormProps.entryId = isEditForm ? propValue : null; + workerTimeFormProps.dated = isEditForm ? null : propValue; + workerTimeFormDialogRef.value.show(); };